Scrubbing a large paint project no longer accumulates every visited frame in RAM. A fault-in-recency LRU keeps the most-recently-paged-in RASTER_RESIDENT_MAX (12) keyframes resident and drops the pixels of older *clean* ones (re-arming their fault-in so they re-page on revisit). The shown frame is always the most-recent fault-in, so it's never evicted. Data-loss safety: a new `dirty` flag marks any keyframe whose `raw_pixels` were mutated by editing (stroke/fill/paint-bucket/floating-lift + their undo/redo) and is NOT yet in the container. Dirty keyframes are NEVER evicted — they're only unpinned from the LRU. The flag is cleared on a successful save, which also re-arms the LRU for the now-clean resident frames so the bound still applies to frames edited this session. Also: the save loop now walks all layers (incl. nested) to match the load path's recursive fault-in arming — evicted frames keep their existing container row (media_exists), and nested raster keyframes are persisted + covered by live_media. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| Cargo.toml | ||