Luke Lau 0bfcaa4109
⚡ Avoid redundant copy of tile atlas (#13104)
61cd9fe88683a4068817f538a2ae54d80aca095e stored a reference to the
last snapshot of the tile atlas, presumably to avoid the call to
image_snapshot when not needed.

But it turns out image_snapshot doesn't actually cost anything since
it just returns a reference to the surface texture. Storing the
reference actually causes a 4096x4096 texture copy because skia has
copy-on-write behaviour. Skia sees the reference stored in Surfaces,
so when the next render tries to draw on the surface it needs to
allocate + copy over the tile atlas texture.

By removing the reference skia can reuse the texture on the next
render which avoids a 64MiB copy on the GPU.

AI-assisted-by: claude-opus-5-5
2026-11-17 13:46:27 +01:00
..
2026-09-02 12:58:52 +02:00