pub enum DrawPrimitive {
Content,
Blend {
primitive: Box<DrawPrimitive>,
blend_mode: BlendMode,
},
Rect {
rect: Rect,
brush: Brush,
stroke: Option<Stroke>,
},
RoundRect {
rect: Rect,
brush: Brush,
radii: CornerRadii,
stroke: Option<Stroke>,
},
Arc {
rect: Rect,
brush: Brush,
center: Point,
radius: f32,
start_angle: f32,
sweep_angle: f32,
stroke: Option<Stroke>,
inner_radius: f32,
},
Image {
rect: Rect,
image: ImageBitmap,
alpha: f32,
color_filter: Option<ColorFilter>,
sampling: ImageSampling,
src_rect: Option<Rect>,
},
Text(Box<TextPrimitive>),
Shadow(ShadowPrimitive),
}Variants§
Content
Marker emitted by draw_content() inside draw_with_content.
This is consumed by the modifier pipeline and never rendered directly.
Blend
Wrapper to associate a draw primitive with a non-default blend mode.
Rect
Fields
RoundRect
Fields
§
radii: CornerRadiiArc
A circular band: a stroked arc, or a filled annular sector / pie wedge.
Angles are radians, 0 = +X, increasing clockwise on screen (see
[crate::stroke] for the full convention).
stroke = Some(_)— the band isradius ± width/2, its ends shaped by the stroke cap.inner_radiusis ignored.stroke = None— the band isinner_radius ..= radiuswith flat (butt) radial ends;inner_radius = 0is a filled pie wedge.
Fields
Image
Text(Box<TextPrimitive>)
A laid-out run of text. See TextPrimitive.
Shadow(ShadowPrimitive)
Shadow that requires blur processing. The renderer decides technique (GPU blur, CPU approximation, etc.).
Trait Implementations§
Source§impl Clone for DrawPrimitive
impl Clone for DrawPrimitive
Source§fn clone(&self) -> DrawPrimitive
fn clone(&self) -> DrawPrimitive
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DrawPrimitive
impl Debug for DrawPrimitive
Source§impl PartialEq for DrawPrimitive
impl PartialEq for DrawPrimitive
Source§impl RenderHash for DrawPrimitive
impl RenderHash for DrawPrimitive
fn render_hash(&self) -> u64
impl StructuralPartialEq for DrawPrimitive
Auto Trait Implementations§
impl !Send for DrawPrimitive
impl !Sync for DrawPrimitive
impl Freeze for DrawPrimitive
impl RefUnwindSafe for DrawPrimitive
impl Unpin for DrawPrimitive
impl UnsafeUnpin for DrawPrimitive
impl UnwindSafe for DrawPrimitive
Blanket Implementations§
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
Mutably borrows from an owned value. Read more