pub enum DrawCommand {
Show 30 variants
DrawRect {
bounds: Rect,
color: Color,
},
DrawRoundedRect {
bounds: Rect,
color: Color,
border_radius: BorderRadius,
border_width: EdgeInsets<f32>,
border_color: Option<Color>,
},
DrawShadow {
bounds: Rect,
shadow: BoxShadow,
border_radius: BorderRadius,
},
DrawInsetShadow {
bounds: Rect,
shadow: BoxShadow,
border_radius: BorderRadius,
},
DrawLinearGradient {
bounds: Rect,
angle_deg: f32,
stops: Vec<ColorStop>,
border_radius: BorderRadius,
},
DrawRadialGradient {
bounds: Rect,
center: (f32, f32),
stops: Vec<ColorStop>,
border_radius: BorderRadius,
},
PushBackdropFilter {
bounds: Rect,
radius: BorderRadius,
filter: BackdropFilter,
},
PopBackdropFilter,
PushFilter {
bounds: Rect,
filter: BackdropFilter,
},
PopFilter,
PushClipPath {
bounds: Rect,
clip_path: ClipPath,
},
PopClipPath,
PushBlendMode {
mode: BlendMode,
},
PopBlendMode,
PushIsolation {
isolate: bool,
},
PopIsolation,
PushOpacity {
alpha: f32,
},
PopOpacity,
DrawBorder {
bounds: Rect,
widths: EdgeInsets<f32>,
color: Color,
border_radius: BorderRadius,
style: BorderStyle,
},
DrawText {
origin: (f32, f32),
bounds_width: Option<f32>,
bounds_height: Option<f32>,
text_align: TextAlign,
text: String,
font_size: f32,
line_height: f32,
font_weight: FontWeight,
color: Color,
is_monospace: bool,
font_family: AtomId,
},
DrawTextFragments {
fragments: Vec<TextFragment>,
},
DrawViewport3D {
bounds: Rect,
scene: Arc<Scene3D>,
},
DrawCanvas2D {
bounds: Rect,
commands: Vec<CanvasCommand>,
},
DrawSvgPath {
bounds: Rect,
path_data: String,
stroke_color: Option<Color>,
fill_color: Option<Color>,
stroke_width: f32,
stroke_linecap: StrokeLineCap,
stroke_linejoin: StrokeLineJoin,
stroke_dasharray: Vec<f32>,
fill_rule: FillRule,
view_box: (f32, f32),
},
DrawGpuPath {
bounds: Rect,
path: Path,
stroke: Option<StrokeOptions>,
fill_color: Option<Color>,
stroke_color: Option<Color>,
transform: Option<Matrix4x4>,
},
DrawImage {
bounds: Rect,
image: ImageResource,
},
PushClip {
bounds: Rect,
radius: BorderRadius,
},
PopClip,
PushTransform {
matrix: Matrix4x4,
},
PopTransform,
}Expand description
Low-level drawing primitives emitted to GPU command buffers.
Variants§
DrawRect
DrawRoundedRect
DrawShadow
DrawInsetShadow
DrawLinearGradient
DrawRadialGradient
PushBackdropFilter
PopBackdropFilter
PushFilter
PopFilter
PushClipPath
PopClipPath
PushBlendMode
PopBlendMode
PushIsolation
PopIsolation
PushOpacity
PopOpacity
DrawBorder
DrawText
Fields
§
font_weight: FontWeightDrawTextFragments
Fields
§
fragments: Vec<TextFragment>DrawViewport3D
DrawCanvas2D
DrawSvgPath
DrawGpuPath
Fields
§
stroke: Option<StrokeOptions>DrawImage
PushClip
PopClip
PushTransform
PopTransform
Implementations§
Source§impl DrawCommand
impl DrawCommand
Sourcepub fn is_clip(&self) -> bool
pub fn is_clip(&self) -> bool
Returns true if this command is a clipping push or pop instruction.
Sourcepub fn is_state_command(&self) -> bool
pub fn is_state_command(&self) -> bool
Returns true if this command mutates the render stack (push or pop).
Stack commands must never be spatially culled, otherwise a pop would be executed without its matching push (for example a Cairo group pop with no group to pop).
Trait Implementations§
Source§impl Clone for DrawCommand
impl Clone for DrawCommand
Source§impl Debug for DrawCommand
impl Debug for DrawCommand
Source§impl PartialEq for DrawCommand
impl PartialEq for DrawCommand
impl StructuralPartialEq for DrawCommand
Auto Trait Implementations§
impl Forget for DrawCommand
impl Freeze for DrawCommand
impl Move for DrawCommand
impl RefUnwindSafe for DrawCommand
impl Send for DrawCommand
impl Sync for DrawCommand
impl Unpin for DrawCommand
impl UnsafeUnpin for DrawCommand
impl UnwindSafe for DrawCommand
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