mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-30 05:16:56 -06:00
Once a zoom had paused, the browser drew its full render in one frame. On a heavy page that frame took seconds, and no input was handled meanwhile: the wheel steps and drags that came were seen only when it was over. The renderer's `Retained::begin` hands a full render back as `Steps`, drawn `band_h` rows at a time with the same `render_band` and `put_band` the desktop's parallel bands use (bands overlap by what background blurs read and keep their own rows; a blur reaching past a band makes the bands taller rather than one piece), and `finish` keeps the image as a full render. A render that is reused or patched is done at once, as before. The browser's `Inline` worker refines through `Renders::refine_for`, which draws at least a band a frame, more while they fit in `STEP_MS` (24 ms), and asks for the next frame while bands remain, so input is handled between them; a view has at most eight bands, so on a page whose render takes seconds the longest frame is about an eighth of it. A render drawn for the very request is done once drawn. A pan or an edit meanwhile at the same zoom keeps the render going and is patched in once it is drawn; a pan too far to patch or an edit the patch can't take draws it again in steps, the image just drawn showing till then (`Refined::Shown`); a zoom, another page or file, another size or other render options drop the render for one of the new view, and what its bands took stands as the measure the next zoom's preview and wait go by. A render in steps counts as one render (glass keeps the shapes a later render asks for again). The desktop, with its render thread, is unchanged. Measured in Chrome on two synthetic pages (20 images and 60 shadowed rectangles, with and without two background-blur panels) whose full render takes 3.6–4.0 s at a deep zoom: the longest frame while that render runs went from 3.7–4.0 s to 0.9–1.4 s (blur) and 0.69–0.80 s (no blur); the bands together take longer than one render (the refined image comes after 6.7–8.1 s and 5.3–5.5 s instead of 3.8–4.1 s), each band rendering its overlap again and repeating some per-band work, shadows mostly. The zoom steps are as before. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>