pub struct CommandRecorder { /* private fields */ }Expand description
Mutable command data owned exclusively while a draw scope records it.
Publishing with Self::finish shares the completed shape data without copying it.
Implementations§
Source§impl CommandRecorder
impl CommandRecorder
Sourcepub fn from_primitives(
primitives: impl IntoIterator<Item = DrawPrimitive>,
) -> Self
pub fn from_primitives( primitives: impl IntoIterator<Item = DrawPrimitive>, ) -> Self
Records primitives in order into owned command data.
Sourcepub fn reusing(recording: CommandRecording) -> Self
pub fn reusing(recording: CommandRecording) -> Self
Reuses a completed command’s buffer capacities for an empty recording. Retained readers keep their original shape data.
Sourcepub fn finish(self) -> CommandRecording
pub fn finish(self) -> CommandRecording
Publishes completed command data without copying its shape columns.
Sourcepub fn content_markers(&self) -> u32
pub fn content_markers(&self) -> u32
The number of recorded content markers.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Empties the recording, keeping every buffer’s capacity for the next recording into it.
Sourcepub fn reserve_shapes(&mut self, additional: usize)
pub fn reserve_shapes(&mut self, additional: usize)
Reserves capacity for additional shape records.
Sourcepub fn push_content(&mut self)
pub fn push_content(&mut self)
Records a content marker at the current command position.
Sourcepub fn push_primitive(&mut self, primitive: DrawPrimitive)
pub fn push_primitive(&mut self, primitive: DrawPrimitive)
Records a primitive the way the draw scope would have: shapes and blended shapes become records, everything else joins the others lane.
Sourcepub fn push_rect(
&mut self,
rect: Rect,
brush: &Brush,
stroke: Option<Stroke>,
blend: BlendMode,
)
pub fn push_rect( &mut self, rect: Rect, brush: &Brush, stroke: Option<Stroke>, blend: BlendMode, )
Records a rectangle with its brush, optional stroke and blend mode.
Sourcepub fn push_round_rect(
&mut self,
rect: Rect,
brush: &Brush,
radii: CornerRadii,
stroke: Option<Stroke>,
blend: BlendMode,
)
pub fn push_round_rect( &mut self, rect: Rect, brush: &Brush, radii: CornerRadii, stroke: Option<Stroke>, blend: BlendMode, )
Records a rounded rectangle with its corner radii and paint.
Sourcepub fn push_arc(&mut self, rect: Rect, args: &ArcRecordArgs<'_>)
pub fn push_arc(&mut self, rect: Rect, args: &ArcRecordArgs<'_>)
Records an arc band or annular sector with the rect the primitive carries.
Sourcepub fn push_scope_arc(
&mut self,
args: &ArcRecordArgs<'_>,
geometry: &ArcGeometry,
)
pub fn push_scope_arc( &mut self, args: &ArcRecordArgs<'_>, geometry: &ArcGeometry, )
Records an arc the draw scope drew, whose band the scope already normalised: the record keeps the disc around the band as its rect and derives the primitive’s tight bounds only when asked.
Sourcepub fn push_other(&mut self, primitive: DrawPrimitive)
pub fn push_other(&mut self, primitive: DrawPrimitive)
Records a primitive in the non-shape lane and updates its metadata.
Sourcepub fn merge_summary(&mut self, other: RecordingSummary)
pub fn merge_summary(&mut self, other: RecordingSummary)
Folds other’s summary into this recording’s, for callers that
combine recordings.
Trait Implementations§
Source§impl Clone for CommandRecorder
impl Clone for CommandRecorder
Source§fn clone(&self) -> CommandRecorder
fn clone(&self) -> CommandRecorder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more