Skip to main content

DrawCommand

Enum DrawCommand 

Source
#[non_exhaustive]
pub enum DrawCommand { ParticleInstances { batch: Arc<dyn InstanceBatch>, transform: Transform, }, PushFilterLayer { bounds: Rect, filters: Vec<Filter>, }, PushLayer { opacity: f64, bounds: Rect, blend_mode: BlendMode, clip: Option<PathClip>, }, PushRectLayer { opacity: f64, bounds: Rect, blend_mode: BlendMode, clip: Option<PathClip>, rect_clip: RectClip, }, PushShapeLayer { opacity: f64, bounds: Rect, blend_mode: BlendMode, clip: Option<PathClip>, rect_clip: Option<RectClip>, shape_clip: ShapeClip, }, PopLayer, BeginMask { mode: MaskMode, }, EndMask, FillRect { bounds: Rect, transform: Transform, paint: Paint, }, Fill { path: Arc<Path2D>, transform: Transform, paint: Paint, rule: FillRule, }, }
Expand description

A fill or isolated-layer boundary; more primitives await their contracts.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ParticleInstances

Particle instances, independent of path strips.

Fields

§batch: Arc<dyn InstanceBatch>

Immutable validated instance/style/program payload.

§transform: Transform

Local-to-device mapping.

§

PushFilterLayer

Begins a source-only filter capture in an independent geometric domain.

Fields

§bounds: Rect

Device bounds of the input; preparation derives intermediate/output bounds.

§filters: Vec<Filter>

Validated device-unit filters in declaration order.

§

PushLayer

Begins isolated composition of subsequent commands.

Fields

§opacity: f64

Group opacity, retained as f64 until preparation.

§bounds: Rect

Conservative device-coordinate capture bounds, not a clip.

§blend_mode: BlendMode

Mode applied once against the parent when this layer completes.

§clip: Option<PathClip>

Optional path coverage applied once before layer opacity and blending.

§

PushRectLayer

Begins isolation with an additional geometric rectangle clip.

Fields

§opacity: f64

Opacity applied after the completed subtree is clipped.

§bounds: Rect

Conservative device capture bounds, not a clipping region.

§blend_mode: BlendMode

Mode applied once against the immediate parent backdrop.

§clip: Option<PathClip>

Independent path coverage, retaining its multiplicative semantics.

§rect_clip: RectClip

Device rectangle intersected with ancestor geometric clips.

§

PushShapeLayer

Begins isolation with geometric Shape intersection and optional rectangle.

Fields

§opacity: f64

Opacity applied after the subtree is clipped.

§bounds: Rect

Conservative device capture bounds, not a clipping region.

§blend_mode: BlendMode

Mode applied once against the immediate parent backdrop.

§clip: Option<PathClip>

Independent multiplicative path coverage.

§rect_clip: Option<RectClip>

Optional additional geometric rectangle on this same layer.

§shape_clip: ShapeClip

Shape region intersected with all geometric ancestors.

§

PopLayer

Ends the most recent isolated layer.

§

BeginMask

Begins isolated mask artwork for the current completed layer.

Fields

§mode: MaskMode

Extraction mode applied once at EndMask.

§

EndMask

Applies completed mask artwork; only PopLayer may follow in that layer.

§

FillRect

Fills an axis-aligned logical rectangle, preserving its opposite corners.

Fields

§bounds: Rect

Local f64 bounds, independent of the output scale.

§transform: Transform

Local-to-device mapping; identity in standalone Canvas recording.

§paint: Paint

Floating paint.

§

Fill

Fills a logical path; open contours close implicitly for filling.

Fields

§path: Arc<Path2D>

Shared checked f64 geometry, flattened only by the backend.

§transform: Transform

Local-to-device mapping; identity in standalone Canvas recording.

§paint: Paint

floating paint.

§rule: FillRule

Explicit contour interpretation, retained without approximation.

Trait Implementations§

Source§

impl Clone for DrawCommand

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DrawCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for DrawCommand

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DrawCommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.