| CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
script: Skip running layout when only updating images or canvas #38991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
script: Skip running layout when only updating images or canvas #38991
Conversation
|
🔨 Triggering try run (#17290226074) for Linux (Production, WPT) |
|
|
0be2e0a to
d29ca6a
Compare
|
🔨 Triggering try run (#17293175543) for Linux (Production, WPT) |
|
🔨 Triggering try run (#17293177114) for Linux (Production, WPT) |
|
Test results for linux-wpt from try job (#17293177114): Flaky unexpected result (7)
Stable unexpected results (21)
|
|
|
sagudev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Test results for linux-wpt from try job (#17293175543): Flaky unexpected result (18)
Stable unexpected results (21)
|
|
|
|
I believe this can also optimize these reflows triggerred by fetch state change of css background image or border image resources. Besides, I am considering the following optimization: when only updating the fetch state of image resources, skip running restyle and incremental box tree construction, and instead only running layout and subsequent reflow phases. We maybe need to add a new kind of Then we might need to run minor incremental box tree construction that only acts on nodes related to Do you think that is feasible? |
Please ignore it for now. I believe it is not yet the right time to implement this idea. It relies on the complete version of storing layout data for multi-level nested pseudo-element. |
|
though: When clearing canvas (without updating the image like we will do for webgpu) we still need to mark it as dirty otherwise layout uses cached imagekey based on my testing from making async image updates. |
This design means that WebGPU canvases will never be able to skip layout when clearing which seems like it will seriously limit performance. If possible you want to avoid doing a layout 60 times a second! Instead of setting a |
That could work, yes. Although I think the benefit of not setting imagekey is that we could avoided alloc and sending it. Currently I think we can only do this by setting externalimage as invalid texture (id 0). |
…er separately (#39627) Before both canvas updates and layout had their own `Epoch`. This change makes it so the `Epoch` is shared. This means that display lists might have non-consecutive `Epoch`s, but will also allow for the `Epoch` in the renderer to update even when no new display list is produced. This is important for #38991. In that PR the display list step can be skipped for canvas-only updates, but the `Epoch` in the renderer must still advance. Testing: This shouldn't change the user-observable behavior and is thus covered by existing tests. It should prevent flakiness once #38991 lands. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
bcfb136 to
b8be9d6
Compare
b8be9d6 to
8ab2bda
Compare
Add a new super-lightweight layout mode that avoids any layout when canvas is updated or animated images progress to the next frame. In the future this can also be used for video elements. Currently, WebGPU does not seem to track when canvases are dirty, so a very high-level flag is used in the cases when WebGPU canvases are actually marked as dirty (not the majority of the time). Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
8ab2bda to
f4bf18c
Compare
Add a new super-lightweight layout mode that avoids any layout when
canvas is updated or animated images progress to the next frame. In the
future this can also be used for video elements.
Testing: This is a performance optimization, so shouldn't change any
WPT test results.