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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/// Number of 2-way associative sets in `TextSizeCache` (power of two).
pub const TEXT_SIZE_CACHE_SETS: usize = 1024;
/// Bitmask for mapping a mixed hash to a `TextSizeCache` set index.
pub const TEXT_SIZE_CACHE_SET_MASK: usize = TEXT_SIZE_CACHE_SETS - 1;
/// Number of associative ways per set in `TextSizeCache`.
pub const TEXT_SIZE_CACHE_WAYS: usize = 2;
/// Total number of slots in `TextSizeCache`.
pub const TEXT_SIZE_CACHE_SLOTS: usize = TEXT_SIZE_CACHE_SETS * TEXT_SIZE_CACHE_WAYS;
/// Occupancy bit set in `TextStyleKey::style_flags` for populated cache slots.
pub const TEXT_SIZE_ENTRY_OCCUPIED: u16 = 1 << 8;
/// Sentinel bit pattern representing `max_width == None` in `TextSizeEntry`.
pub const TEXT_SIZE_MAX_WIDTH_NONE_BITS: u32 = u32MAX;
/// `TextSizeEntry::entry_flags` bit indicating `(max_content_w, single_line_h)` is populated.
pub const TEXT_SIZE_ENTRY_HAS_UNWRAPPED: u8 = 1 << 0;
/// `TextSizeEntry::entry_flags` bit indicating `(last_max_w_bits, last_wrapped_w, last_wrapped_h)` is populated.
pub const TEXT_SIZE_ENTRY_HAS_WRAPPED: u8 = 1 << 1;
/// `TextSizeEntry::entry_flags` bit indicating unconstrained `max_width == None` `(none_w, none_h)` is populated.
pub const TEXT_SIZE_ENTRY_HAS_NONE: u8 = 1 << 2;
/// `TextSizeEntry::entry_flags` bit indicating `min_content_w` is populated.
pub const TEXT_SIZE_ENTRY_HAS_MIN_CONTENT: u8 = 1 << 3;
/// Primary 64-bit hash seed for `TextSizeCache`.
pub const TEXT_HASH_SEED_A: u64 = 0xcbf2_9ce4_8422_2325;
/// Secondary 64-bit hash seed for `TextSizeCache`.
pub const TEXT_HASH_SEED_B: u64 = 0x9e37_79b9_7f4a_7c15;
/// Primary 64-bit hash multiplier for `TextSizeCache`.
pub const TEXT_HASH_PRIME_A: u64 = 0x0000_0100_0000_01b3;
/// Secondary 64-bit hash multiplier for `TextSizeCache`.
pub const TEXT_HASH_PRIME_B: u64 = 0x517c_c1b7_2722_0a95;
/// Primary Murmur3/SplitMix64 avalanche constant for `TextSizeCache`.
pub const TEXT_HASH_FINAL_A: u64 = 0xff51_afd7_ed55_8ccd;
/// Secondary Murmur3/SplitMix64 avalanche constant for `TextSizeCache`.
pub const TEXT_HASH_FINAL_B: u64 = 0xc4ce_b9fe_1a85_ec53;
/// Number of LRU measure cache slots per node inside `SplitLayoutCache`.
pub const MEASURE_CACHE_SLOTS: usize = 4;
/// Empty layout dependency bitmask (measurement independent of available space and viewport).
pub const LAYOUT_DEP_NONE: u8 = 0;
/// Layout dependency bit indicating measurement depended on incoming available width.
pub const LAYOUT_DEP_AVAIL_W: u8 = 1 << 0;
/// Layout dependency bit indicating measurement depended on incoming available height.
pub const LAYOUT_DEP_AVAIL_H: u8 = 1 << 1;
/// Layout dependency bit indicating measurement depended on root viewport dimensions (`vw`/`vh`).
pub const LAYOUT_DEP_VIEWPORT: u8 = 1 << 2;
/// `SplitLayoutCache::subtree_flags` bit indicating `subtree_bounds[idx]` is valid for the live node generation.
pub const SUBTREE_FLAG_VALID: u8 = 1 << 0;
/// `SplitLayoutCache::subtree_flags` bit indicating the container has at least one child with `z_index != 0`.
pub const SUBTREE_FLAG_NONZERO_Z_CHILD: u8 = 1 << 1;
/// `FlexItemRecord::flags` bit indicating `LayoutStyle::width == Length::Auto`.
pub const FLEX_ITEM_WIDTH_AUTO: u16 = 1 << 0;
/// `FlexItemRecord::flags` bit indicating `LayoutStyle::height == Length::Auto`.
pub const FLEX_ITEM_HEIGHT_AUTO: u16 = 1 << 1;
/// `FlexItemRecord::flags` bit indicating `LayoutStyle::width` is `Length::Percent(_)`.
pub const FLEX_ITEM_WIDTH_PERCENT: u16 = 1 << 2;
/// `FlexItemRecord::flags` bit indicating `LayoutStyle::height` is `Length::Percent(_)`.
pub const FLEX_ITEM_HEIGHT_PERCENT: u16 = 1 << 3;
/// Default `FlexItemRecord::flags` mask for an unattached auto-sized fallback entry.
pub const FLEX_ITEM_DEFAULT_FLAGS: u16 = FLEX_ITEM_WIDTH_AUTO + FLEX_ITEM_HEIGHT_AUTO;