mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-27 03:10:01 +00:00
Until now, every paint phase of every PaintableBox injected its own clipping sequence into the display list: ``` before_paint: Save AddClipRect (1) ...clip rectangles for each containing block with clip... AddClipRect (N) paint: ...paint phase items... after_paint: Restore ``` Because we ran that sequence for every phase of every box, Skia had to rebuild clip stack `paint_phases * paintable_boxes` times. Worse, usually most paint phases contribute no visible drawing at all, yet we still had to emit clipping items because `before_paint()` has no way to know that in advance. This change takes a different approach: - Clip information is now attached as metadata `ClipFrame` to each DisplayList item. - `DisplayListPlayer` groups consecutive commands that share a `ClipFrame`, applying the clip once at the start of the group and restoring it once at the end. Going from 10 ms to 5 ms in rasterization on Discord might not sound like much, but keep in mind that for 60fps we have 16 ms per frame and there is a lot more work besides display list rasterization we do in each frame. * https://discord.com/channels/1247070541085671459/1247090064480014443 - DisplayList items: 81844 -> 3671 - rasterize time: 10 ms -> 5 ms - record time: 5 ms -> 3 ms * https://github.com/LadybirdBrowser/ladybird - DisplayList items: 7902 -> 1176 - rasterize time: 4 ms -> 4 ms - record time: 3 ms -> 2 ms |
||
---|---|---|
.. | ||
simple-overflow-hidden.txt |