pub struct ShapeRecorder { /* private fields */ }Expand description
The POD half of a recording as it is written: the shape records with
their brush and stop tables and coalesced segments, and the bounds
those records reach. Plain data throughout, so a scene carries one
across threads; CommandRecording wraps it with the other lane.
Implementations§
Source§impl ShapeRecorder
impl ShapeRecorder
Sourcepub fn tables(&self) -> &RecordTables
pub fn tables(&self) -> &RecordTables
The owned shape columns and their brush, stop and segment tables.
pub fn is_empty(&self) -> bool
Sourcepub fn all_segments(&self) -> Range<u32> ⓘ
pub fn all_segments(&self) -> Range<u32> ⓘ
Every segment, the range a run of the whole recording draws.
Sourcepub fn bounds(&self) -> Option<Rect>
pub fn bounds(&self) -> Option<Rect>
The rect every recorded shape’s pixels lie within; None when
nothing was recorded.
Sourcepub fn fingerprint(&self) -> u64
pub fn fingerprint(&self) -> u64
The tables’ fingerprint; see RecordTables::fingerprint.
Sourcepub fn push_primitive(&mut self, primitive: DrawPrimitive) -> Recorded
pub fn push_primitive(&mut self, primitive: DrawPrimitive) -> Recorded
Records a rect, rounded rect or arc, blended or not; hands any other primitive back untouched.
Sourcepub fn push_shape_primitive(
&mut self,
primitive: DrawPrimitive,
blend_mode: BlendMode,
) -> Recorded
pub fn push_shape_primitive( &mut self, primitive: DrawPrimitive, blend_mode: BlendMode, ) -> Recorded
Records a rect, rounded rect or arc with the supplied blend mode. Returns any other primitive untouched, including blend wrappers.
Sourcepub fn push_line(
&mut self,
line: &LineGeometry,
brush: &Brush,
stroke: Stroke,
blend: BlendMode,
) -> Rect
pub fn push_line( &mut self, line: &LineGeometry, brush: &Brush, stroke: Stroke, blend: BlendMode, ) -> Rect
Records the segment line stroked with stroke and returns the
pixels it can reach. The ends ride in the arc columns, and the unit
direction and half length the vertex stage orients its quad by in
the curve column; a degenerate segment is kept, as the app drew it,
and draws nothing.
Sourcepub fn push_trapezoids(
&mut self,
brush_rect: Rect,
trapezoids: &[Trapezoid],
brush: &Brush,
blend: BlendMode,
) -> Rect
pub fn push_trapezoids( &mut self, brush_rect: Rect, trapezoids: &[Trapezoid], brush: &Brush, blend: BlendMode, ) -> Rect
Records the slices of a path fill, each painted by brush resolved
against brush_rect, and returns the box they reach. The brush is
interned once for them all. A slice’s corners ride in the arc
column; its sides and width, which is never zero, in the curve’s
normalised column, so no slice’s row equals a band’s, whose trig
the GPU writes into its radii; and the brush rect in the radii.
pub fn push_rect( &mut self, rect: Rect, brush: &Brush, stroke: Option<Stroke>, blend: BlendMode, ) -> Rect
pub fn push_round_rect( &mut self, rect: Rect, brush: &Brush, radii: CornerRadii, stroke: Option<Stroke>, blend: BlendMode, ) -> Rect
Sourcepub fn push_arc(&mut self, rect: Rect, args: &ArcRecordArgs<'_>) -> Rect
pub fn push_arc(&mut self, rect: Rect, args: &ArcRecordArgs<'_>) -> Rect
Records an arc band or annular sector with the rect the primitive carries.
Sourcepub fn push_scope_arc(
&mut self,
args: &ArcRecordArgs<'_>,
geometry: &ArcGeometry,
) -> Rect
pub fn push_scope_arc( &mut self, args: &ArcRecordArgs<'_>, geometry: &ArcGeometry, ) -> Rect
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.
The scope records only bands that enclose area, so the band is known not to be degenerate.