pub struct DrawRunNode {
pub phase: PrimitivePhase,
pub command: Option<DrawCommandId>,
pub recording: Rc<CommandRecording>,
pub segments: Range<u32>,
pub summary: DrawRunSummary,
}Expand description
A run of recorded draw primitives from one draw command, kept together as one node.
Fields§
§phase: PrimitivePhaseWhether the run draws before or after the children of its layer.
command: Option<DrawCommandId>Which draw command recorded these primitives. None only for runs
with no per-command provenance (hand-built tests).
recording: Rc<CommandRecording>The recording registry keeps a handle per layout node and command, so this recording’s buffers survive the draw run being dropped and the command can record into them on a later update. Nothing mutates a recording after construction, which is what makes sharing sound.
segments: Range<u32>The segments of the recording this run draws: one placement’s part of a with-content command, or the whole recording.
summary: DrawRunSummaryContent facts consumers keep asking per frame, answered while recording and never by rescanning.
Implementations§
Source§impl DrawRunNode
impl DrawRunNode
Sourcepub fn new(phase: PrimitivePhase, primitives: Vec<DrawPrimitive>) -> Self
pub fn new(phase: PrimitivePhase, primitives: Vec<DrawPrimitive>) -> Self
Creates a run for primitives that has no draw command provenance.
Sourcepub fn for_command(
phase: PrimitivePhase,
command: Option<DrawCommandId>,
primitives: Vec<DrawPrimitive>,
) -> Self
pub fn for_command( phase: PrimitivePhase, command: Option<DrawCommandId>, primitives: Vec<DrawPrimitive>, ) -> Self
Creates a run for primitives recorded by the draw command command.
Creates a run over segments of an existing shared recording, without copying it.
Sourcepub fn primitives(&self) -> impl Iterator<Item = DrawPrimitive> + '_
pub fn primitives(&self) -> impl Iterator<Item = DrawPrimitive> + '_
The run’s primitives, materialised from the recording in order.
Sourcepub fn coverage_rects(&self) -> impl Iterator<Item = Rect> + '_
pub fn coverage_rects(&self) -> impl Iterator<Item = Rect> + '_
The rect every entry of the run can reach.