mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-28 20:16:52 -06:00
M4.14: content-keyed RAM preview frames; proxies in the disk cache's content key
- FrameKey's identity is the comp's content (frames::comp_content), not the project revision: an edit keeps the cached frames of comps it doesn't touch and undo finds the frames of the state it returns to. The identity hashes the addresses of the comps a comp draws (~0.1 ms on the 1500-layer test project; the full content hash took ~117 ms), by value the footage, solids, proxies and project settings; with expressions, every item. Frames::content_of keeps a project snapshot per identity with frames (or in flight), so Arc::make_mut always copies an edited comp and its address can't be reused meanwhile; past 64 identities the least recently used go with their frames (long drags). - drop_stale is gone (frames of other contents are evicted least-recently-shown first). - disk_cache::comp_content_key covers items' proxies and Use Proxy (it served stale frames). - Tests: frames (content keys, edits elsewhere and undo, bounded drags, in-place edit safety), ui_ram_preview (end to end), the disk cache proxy key. Docs: roadmap (M4 done), parity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
4f7723a7b6
commit
26c714db7f
@@ -119,4 +119,13 @@ fn footage_changes_change_the_salt() {
|
||||
// Unrelated comps do not change it.
|
||||
s.execute("comp.new", json!({"name": "Other", "width": 10, "height": 10, "frameRate": 30, "duration": 1})).unwrap();
|
||||
assert_eq!(effectcraft_render::disk_cache::comp_content_key(&s.project, cid), k2);
|
||||
// A proxy, and its Use Proxy switch, change the pixels.
|
||||
let set_proxy = |s: &mut Session, enabled: bool| {
|
||||
let it = std::sync::Arc::make_mut(&mut s.project).items.get_mut(&cid).unwrap();
|
||||
it.proxy = Some(Box::new(effectcraft_project::Proxy { footage: effectcraft_project::Footage::default(), enabled }));
|
||||
effectcraft_render::disk_cache::comp_content_key(&s.project, cid)
|
||||
};
|
||||
let k3 = set_proxy(&mut s, true);
|
||||
assert_ne!(k3, k2);
|
||||
assert_ne!(set_proxy(&mut s, false), k3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user