1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! A set of pixel-bearing node ids whose GPU textures must be kept alive
//! while an undo action sits on the stack — and disposed when the action
//! is evicted, *if* the subtree they belong to is currently detached from
//! the document tree.
//!
//! Several undo actions tombstone GPU textures so that flip-flopping undo
//! / redo can resurrect pixels without snapshotting them. The rule each
//! action enforces in `on_evict` has the same shape: *dispose if the
//! subtree the ids belong to is currently detached*. This type encodes
//! that rule once.
//!
//! Each `Tombstones` carries a polarity (`detached_when_applied`) saying
//! whether the subtree is detached on the action's forward side or its
//! undone side. The action passes its own current `applied` flag in and
//! the helper disposes iff the two match.
//!
//! Polarities by action:
//!
//! | Action | Polarity |
//! |--------------------------------------|----------------------|
//! | [`super::DuplicateAction`] | `false` (detached when undone) |
//! | [`super::LayerRemoveAction`] | `true` (detached when applied) |
//! | [`super::BakeLayersAction`] sources | `true` (detached when applied) |
//! | [`super::BakeLayersAction`] result | `false` (detached when undone) |
use crateCompositor;
use crateLayerId;
pub