mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-27 17:51:59 +01:00
With the Navigator open, every edit re-rendered the whole document into a new thumbnail on the UI thread: a full-resolution CPU composite, 303 ms after an opacity change and 486 ms after a brush stroke on a 20 MP layered document. The navigator cache now records the document revision of its image. When the document is exactly one edit ahead, with the same preview key, a bounded last_damage and the same thumbnail size, only the damage (grown by the layers' effect reach) is rendered with render_reduced_damage and written into the texture with set_partial; an edit with empty damage (a rename, a selection, a new empty layer) costs nothing. Anything else renders the whole thumbnail as before. compose gains thumbnail_size, which thumbnail_buffer now uses, so both paths agree on the size. On the 20 MP document: 303 -> 36 ms after an opacity change, 486 -> 171 ms after a stroke (RTX 3090 machine; the navigator renders on the CPU). Test: navigator_damage_updates_match_a_full_thumbnail patches a thumbnail after a translate, an opacity change, a stroke, a blend mode change and a new layer on a document with a drop shadow, and compares it with a full thumbnail; it fails without the effect-reach inflation.