pub struct GroupStack { /* private fields */ }Expand description
The compiler’s stack of open clip, layer and retained brackets.
Retained across frames alongside the clip stack it mirrors —
reset is what keeps it from carrying state between frames.
Every entry here has a counterpart on the clip stack, and the two are pushed and popped together: a bracket is opened by pushing both, and closed by popping both. That is the invariant that lets an unbalanced pop be ignored safely rather than underflowing either one.
Implementations§
Source§impl GroupStack
impl GroupStack
Sourcepub fn push_layer(&mut self, bounds: Rect, isolated: bool)
pub fn push_layer(&mut self, bounds: Rect, isolated: bool)
Open a layer bracket covering bounds.
isolated says whether the layer was recorded as a layer of its own —
a full-opacity one lowered to its clip alone, and has nothing in the
recording for its pop to close.
Sourcepub fn push_retained(&mut self)
pub fn push_retained(&mut self)
Open the bracket a retained body at full opacity records: a layer of its own with no clip behind it.
The inline lowering of such a bracket clips nothing, so neither does this — the body draws exactly the pixels it would have drawn unwrapped, and the layer only gathers them for the retained page. Its bounds are unbounded for the same reason: nothing hoisted past it is confined by it, and nothing drawn inside it is windowed by it.
Sourcepub fn pop(&mut self) -> Option<Group>
pub fn pop(&mut self) -> Option<Group>
Close the innermost open bracket, or None when none is open.