mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-28 10:11:58 +01:00
Session::edit reported damage only for edits that changed no pixels (same_pixels) and left every other edit to recomposite the whole document unless the command reported its own damage. Duplicate and paste do (#2883, #2901), but Fill, Invert, filters, Delete Layer and the undo/redo of a duplicate, a paste or a delete all recomposited everything. - Session::edit now reports step_damage(before, after), the same bound undo and redo use. - step_damage bounds layers only one side has in both directions, so a removed layer counts where it drew like an added one; the bounded_additions flag and insert_damage go, and added_bounds becomes one_sided_bounds. A layer that is (or was) the clipping base of clipped layers above it, an adjustment, a video layer or one excluding channels still recomposites everything (#3090). - The subject-mask cache is dropped only when the step can have changed pixels. perf_scenarios on the layered 20 MP document, edits on a 1 MP layer (p50, RTX 3090, Vulkan): delete layer 9.1 -> 1.4 ms, undo a duplicate 9.3 -> 1.6 ms, fill a 500 px square 17.4 -> 5.5 ms, Invert 16.7 -> 9.2 ms. Duplicate and paste are unchanged (already bounded). Tests: duplicate_paste_and_delete_report_where_the_layer_draws checks that each step, its undo and its redo report the same bounded damage and that no pixel outside it changes. new_layers_that_change_clipping_recomposite_everything (renamed) now expects bounded damage for a painted or empty new layer and None for a new clipping base or an adjustment; deleting and restoring a layer reports its bounds.