Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@flar
Copy link
Contributor

@flar flar commented Jun 5, 2024

The DisplayList will now detect simple single-color rendering ops that cover the entire renderable surface and collect their colors into a "layer clear color" so that the rendering back ends can optimize the initialization of saveLayers.

return true;
}

bool DisplayListBuilder::LayerInfo::update_clear_color(DlColor color,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The render target's clear color will ignore all clips, so any time we add a non-culled clip to the builder we have to turn off clear color optimization.

This is makes clip culling is super important

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of this actually, we may need to do clear color optimization while dispatching instead of recording, but lets discuss today and see if folks have ideas.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought of that last night. I was thinking that turning off the optimization after receiving a clip would do the trick there, but there is also the fact that the DL Builder is still figuring out the right bounds for the save layer while it is recording and won't know the true bounds until Restore is called. So, perhaps this entire optimization is not possible. Or perhaps it only works for DrawColor and DrawPaint that happen right after a SaveLayer but before any clips.

We'll discuss later...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should probably transfer all of the new code to the clip functions to cull unnecessary clips even if it doesn't get used for clear color overlap detection...

bool DisplayListBuilder::LayerInfo::update_clear_color(DlColor color,
DlBlendMode mode) {
if (still_clearing) {
switch (mode) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to support all blend modes, if we clear more than 1 color we perform the blending on the CPU. clear color should not impact max_blend_mode I think

@flar
Copy link
Contributor Author

flar commented Jun 13, 2024

This work was redirected into #53367 after concluding that the appropriate information to know what size destination the rendering ops are targeting is not always available at the DisplayList recording level.

@flar flar closed this Jun 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants