#[repr(C)]pub struct ShapeRecord {
pub rect: [f32; 4],
pub radii: [f32; 4],
pub color: [f32; 4],
pub stroke_width: f32,
pub flags: u32,
pub brush: u32,
pub reserved: u32,
pub arc: [f32; 4],
pub arc_band: [f32; 4],
pub arc_normalized: [f32; 4],
}Expand description
One complete recorded shape in the draw command’s local space.
Every value the app passed is kept verbatim, so the record
materialises back into the exact DrawPrimitive the call described,
and the derived arc values the fragment stage needs sit beside them.
Fields§
§rect: [f32; 4]The primitive’s rect: the app’s rect for rects; for arcs the band’s
tight bounds, or, when Self::has_loose_rect, the disc around the
band that the tight bounds are derived from on demand.
radii: [f32; 4]Rects: the corner radii, top-left, top-right, bottom-right,
bottom-left. Arcs: the band’s trig, see arc_trig.
color: [f32; 4]The solid colour, or the first stop of a gradient brush.
stroke_width: f32The stroke width when Self::is_stroked.
flags: u32Kind, stroke, cap, join, blend mode and arc facts, packed; read them through the accessors.
brush: u320 for a solid brush, otherwise one plus the index into the
recording’s brush table.
reserved: u32Keeps the record at a whole number of 16-byte rows.
arc: [f32; 4]Arcs: centre x, centre y, radius and inner radius as the app drew them.
arc_band: [f32; 4]Arcs: start angle and sweep as the app drew them, then the normalised band’s inner and outer radius.
arc_normalized: [f32; 4]Arcs: the normalised start angle and sweep, then where the band’s strip starts and the padded sweep it covers.
Implementations§
Source§impl ShapeRecord
impl ShapeRecord
pub fn kind(&self) -> u32
pub fn is_stroked(&self) -> bool
Sourcepub fn fragment_kind(&self) -> u32
pub fn fragment_kind(&self) -> u32
Which coverage program the fragment stage runs for this record.
pub fn stroke(&self) -> Option<Stroke>
pub fn blend_mode(&self) -> BlendMode
Sourcepub fn is_degenerate_arc(&self) -> bool
pub fn is_degenerate_arc(&self) -> bool
An arc whose band draws nothing: zero sweep, zero width or a non-finite input. The GPU path collapses it; the primitive still materialises as the app drew it.
pub fn is_gradient(&self) -> bool
Sourcepub fn is_banded(&self) -> bool
pub fn is_banded(&self) -> bool
An arc wide enough to draw as a band strip from the vertex stage; its band class sits in its flags.
Sourcepub fn band_class(&self) -> usize
pub fn band_class(&self) -> usize
The band class this record was filed in: the index into
ARC_BUCKET_SEGMENTS of the strip segments it draws with when
Self::is_banded, zero otherwise.
Sourcepub fn band_segments(&self) -> u32
pub fn band_segments(&self) -> u32
The strip segments this record draws with when Self::is_banded.
Sourcepub fn has_loose_rect(&self) -> bool
pub fn has_loose_rect(&self) -> bool
An arc recorded by the draw scope: its rect is the disc around the band, and the tight cap-aware bounds the primitive carries are derived when asked for, never on the recording path.
Sourcepub fn stored_rect(&self) -> Rect
pub fn stored_rect(&self) -> Rect
The rect as stored: loose for a scope-recorded arc.
Sourcepub fn rect_value(&self) -> Rect
pub fn rect_value(&self) -> Rect
The rect the materialised primitive carries: the tight band bounds for a scope-recorded arc, the stored rect otherwise.
Sourcepub fn coverage_rect(&self) -> Rect
pub fn coverage_rect(&self) -> Rect
The rect this record’s pixels can reach: its rect grown by half the stroke width.
Sourcepub fn arc_geometry(&self) -> Option<ArcGeometry>
pub fn arc_geometry(&self) -> Option<ArcGeometry>
The normalised band the fragment stage draws; None for rects.
Trait Implementations§
Source§impl Clone for ShapeRecord
impl Clone for ShapeRecord
Source§fn clone(&self) -> ShapeRecord
fn clone(&self) -> ShapeRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ShapeRecord
Source§impl Debug for ShapeRecord
impl Debug for ShapeRecord
Source§impl PartialEq for ShapeRecord
impl PartialEq for ShapeRecord
impl Pod for ShapeRecord
impl StructuralPartialEq for ShapeRecord
Auto Trait Implementations§
impl Freeze for ShapeRecord
impl RefUnwindSafe for ShapeRecord
impl Send for ShapeRecord
impl Sync for ShapeRecord
impl Unpin for ShapeRecord
impl UnsafeUnpin for ShapeRecord
impl UnwindSafe for ShapeRecord
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.