Skip to main content

euv_core/scene/flags/
const.rs

1/// Empty dirty bitmask.
2pub const DIRTY_NONE: u16 = 0;
3
4/// Layout geometry needs recomputation for this node.
5pub const DIRTY_LAYOUT: u16 = 1 << 0;
6
7/// Visual paint commands need rebuilding for this node.
8pub const DIRTY_PAINT: u16 = 1 << 1;
9
10/// Text measurement and shaping need recomputation.
11pub const DIRTY_TEXT: u16 = 1 << 2;
12
13/// Children list mutated.
14pub const DIRTY_CHILDREN: u16 = 1 << 3;
15
16/// Scroll offset mutated.
17pub const DIRTY_SCROLL: u16 = 1 << 4;
18
19/// A descendant requires layout recomputation.
20pub const DIRTY_SUBTREE_LAYOUT: u16 = 1 << 5;
21
22/// A descendant requires repainting.
23pub const DIRTY_SUBTREE_PAINT: u16 = 1 << 6;
24
25/// Composite-only property mutated (transform, opacity, or scroll offset) requiring neither layout nor repaint.
26pub const DIRTY_COMPOSITE: u16 = 1 << 7;
27
28/// A descendant requires composite-only update.
29pub const DIRTY_SUBTREE_COMPOSITE: u16 = 1 << 8;
30
31/// All dirty flags combined for freshly mounted nodes.
32pub const DIRTY_ALL: u16 = DIRTY_LAYOUT
33    | DIRTY_PAINT
34    | DIRTY_TEXT
35    | DIRTY_CHILDREN
36    | DIRTY_SCROLL
37    | DIRTY_SUBTREE_LAYOUT
38    | DIRTY_SUBTREE_PAINT
39    | DIRTY_COMPOSITE
40    | DIRTY_SUBTREE_COMPOSITE;
41
42/// Per-node structural flag indicating the arena slot is live.
43pub const NODE_FLAG_ALIVE: u16 = 1 << 0;
44
45/// Per-node structural flag indicating lazily boxed `NodeExtras` metadata is allocated.
46pub const NODE_FLAG_HAS_EXTRAS: u16 = 1 << 1;
47
48/// Per-node structural flag indicating at least one direct child has a non-zero `z_index`.
49pub const NODE_FLAG_HAS_NONZERO_Z_CHILD: u16 = 1 << 2;
50
51/// Per-node structural flag indicating a top-layer `Portal` or `Position::Fixed` node.
52pub const NODE_FLAG_IS_PORTAL: u16 = 1 << 3;
53
54/// Per-node structural flag indicating an active `Overflow::Scroll` container.
55pub const NODE_FLAG_IS_SCROLL_CONTAINER: u16 = 1 << 4;
56
57/// Per-node structural flag indicating one or more attached `Lifecycle` observers.
58pub const NODE_FLAG_HAS_LIFECYCLE: u16 = 1 << 5;
59
60/// Per-node structural flag indicating an attached reactive ownership `Scope`.
61pub const NODE_FLAG_HAS_SCOPE: u16 = 1 << 6;
62
63/// Per-node structural flag indicating the node is currently enqueued in `SceneTree::dirty_paint_nodes`.
64pub(crate) const NODE_FLAG_IN_DIRTY_PAINT_QUEUE: u16 = 1 << 7;
65
66pub(crate) const DIRTY_LAYOUT_PASS_MASK: u16 =
67    DIRTY_LAYOUT + DIRTY_SUBTREE_LAYOUT + DIRTY_TEXT + DIRTY_CHILDREN;
68
69pub(crate) const DIRTY_CHILDREN_CHANGE_MASK: u16 = DIRTY_LAYOUT + DIRTY_PAINT + DIRTY_CHILDREN;
70
71pub(crate) const DIRTY_TEXT_CHANGE_MASK: u16 = DIRTY_LAYOUT + DIRTY_PAINT + DIRTY_TEXT;
72
73pub(crate) const DIRTY_ANCESTOR_LAYOUT_TRIGGER: u16 = DIRTY_LAYOUT + DIRTY_TEXT + DIRTY_CHILDREN;
74
75pub(crate) const DIRTY_ANCESTOR_PAINT_TRIGGER: u16 = DIRTY_PAINT + DIRTY_LAYOUT + DIRTY_CHILDREN;
76
77pub(crate) const DIRTY_ANCESTOR_COMPOSITE_TRIGGER: u16 = DIRTY_COMPOSITE + DIRTY_SCROLL;
78
79pub(crate) const DIRTY_FULL_DAMAGE_MASK: u16 = DIRTY_LAYOUT + DIRTY_CHILDREN + DIRTY_TEXT;
80
81pub(crate) const DIRTY_PAINT_CLEAR_MASK: u16 =
82    DIRTY_PAINT + DIRTY_SUBTREE_PAINT + DIRTY_SCROLL + DIRTY_COMPOSITE + DIRTY_SUBTREE_COMPOSITE;
83
84/// Maximum per-frame surgical dirty paint nodes tracked before promoting to full viewport damage.
85pub(crate) const DIRTY_PAINT_FULL_THRESHOLD: usize = 64;