Luke Lau 14abaf93f4
⚡ Cull tile shapes to the tile instead of its whole margin (#13112)
After background blur support was added to render-wasm in 5ba53f7296,
we needed to start rendering shapes in the 256px margins of the tile,
since they contribute to the blur result.

This means that a tile may end up drawing shapes from the tiles around
it, and in the worst case we end up drawing 4x the number of shapes.

We can limit this to only the tiles that have background blur, which
significantly reduces the number of shapes drawn.

Masked groups do something similar so this generalizes and reuses the
`group_reach` stack, which stores how far past the current tile is
painted.

Before we start drawing the shapes in `render_shape_tree_partial`, we
walk the shapes in the tile to check how far the background blur
"reaches" and extend `group_reach` by just that amount, rather than
a 256px radius. As part of the generalization we also need to update
`masked_group_filter_reach` so it works on non-masked groups.

On the mem_benchmark file a full render calls render_shape 77.1% less
often. On the admin dahsboard there's 62% less. This gain shows up
particularly in interactive transforms, e.g. dragging another board
across the heroicons board goes from about 21 to 48 fps.

AI-assisted-by: claude-opus-5-5
2026-11-18 07:07:53 +01:00
..
2026-06-02 09:38:52 +02:00
2026-06-29 10:34:44 +02:00
2026-06-02 09:38:52 +02:00
2026-06-02 09:38:52 +02:00
2026-07-03 08:37:22 +02:00