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
42pub(crate) const DIRTY_LAYOUT_PASS_MASK: u16 =
43    DIRTY_LAYOUT + DIRTY_SUBTREE_LAYOUT + DIRTY_TEXT + DIRTY_CHILDREN;
44
45pub(crate) const DIRTY_CHILDREN_CHANGE_MASK: u16 = DIRTY_LAYOUT + DIRTY_PAINT + DIRTY_CHILDREN;
46
47pub(crate) const DIRTY_TEXT_CHANGE_MASK: u16 = DIRTY_LAYOUT + DIRTY_PAINT + DIRTY_TEXT;
48
49pub(crate) const DIRTY_ANCESTOR_LAYOUT_TRIGGER: u16 = DIRTY_LAYOUT + DIRTY_TEXT + DIRTY_CHILDREN;
50
51pub(crate) const DIRTY_ANCESTOR_PAINT_TRIGGER: u16 =
52    DIRTY_PAINT + DIRTY_SCROLL + DIRTY_LAYOUT + DIRTY_CHILDREN;
53
54pub(crate) const DIRTY_ANCESTOR_COMPOSITE_TRIGGER: u16 = DIRTY_COMPOSITE + DIRTY_SCROLL;
55
56pub(crate) const DIRTY_FULL_DAMAGE_MASK: u16 = DIRTY_LAYOUT + DIRTY_CHILDREN + DIRTY_TEXT;
57
58pub(crate) const DIRTY_PAINT_CLEAR_MASK: u16 =
59    DIRTY_PAINT + DIRTY_SUBTREE_PAINT + DIRTY_SCROLL + DIRTY_COMPOSITE + DIRTY_SUBTREE_COMPOSITE;
60
61/// Maximum per-frame surgical dirty paint nodes tracked before promoting to full viewport damage.
62pub(crate) const DIRTY_PAINT_FULL_THRESHOLD: usize = 64;