pub struct DrawList { /* private fields */ }Expand description
An ordered buffer of DrawCommands, with integrated clip-stack and bounds
tracking.
Build a list with the typed push_* helpers (or the low-level push)
then pass it to a RenderBackend::execute call.
Implementations§
Source§impl DrawList
impl DrawList
Sourcepub fn push(&mut self, cmd: DrawCommand)
pub fn push(&mut self, cmd: DrawCommand)
Append an arbitrary DrawCommand, automatically updating clip depth
and accumulated bounds.
Sourcepub fn iter(&self) -> Iter<'_, DrawCommand>
pub fn iter(&self) -> Iter<'_, DrawCommand>
Iterate over all commands in submission order.
Sourcepub fn bounds(&self) -> Option<Rect>
pub fn bounds(&self) -> Option<Rect>
Return the accumulated axis-aligned bounding box of all non-clip draw
commands, or None if no draw commands have been pushed.
Sourcepub fn clip_depth(&self) -> usize
pub fn clip_depth(&self) -> usize
Return the current clip-stack depth. Zero means balanced.
Sourcepub fn is_clip_balanced(&self) -> bool
pub fn is_clip_balanced(&self) -> bool
Return true if the clip stack is balanced (depth == 0).
Sourcepub fn push_stroke_rect(&mut self, rect: Rect, thickness: f32, color: Color)
pub fn push_stroke_rect(&mut self, rect: Rect, thickness: f32, color: Color)
Push a stroked rectangle outline.
Sourcepub fn push_rounded_rect(&mut self, rect: Rect, radius: f32, color: Color)
pub fn push_rounded_rect(&mut self, rect: Rect, radius: f32, color: Color)
Push a filled rectangle with uniform corner radius.
Sourcepub fn push_rounded_rect_per_corner(
&mut self,
rect: Rect,
radii: [f32; 4],
color: Color,
)
pub fn push_rounded_rect_per_corner( &mut self, rect: Rect, radii: [f32; 4], color: Color, )
Push a filled rectangle with per-corner radii [tl, tr, br, bl].
Sourcepub fn push_circle(&mut self, center: Point, radius: f32, color: Color)
pub fn push_circle(&mut self, center: Point, radius: f32, color: Color)
Push a filled circle.
Sourcepub fn push_ellipse(&mut self, center: Point, rx: f32, ry: f32, color: Color)
pub fn push_ellipse(&mut self, center: Point, rx: f32, ry: f32, color: Color)
Push a filled ellipse.
Sourcepub fn push_line(&mut self, from: Point, to: Point, color: Color)
pub fn push_line(&mut self, from: Point, to: Point, color: Color)
Push a 1-pixel aliased line segment.
Sourcepub fn push_line_aa(&mut self, from: Point, to: Point, color: Color)
pub fn push_line_aa(&mut self, from: Point, to: Point, color: Color)
Push a 1-pixel anti-aliased line segment.
Sourcepub fn push_line_thick(
&mut self,
from: Point,
to: Point,
width: f32,
color: Color,
)
pub fn push_line_thick( &mut self, from: Point, to: Point, width: f32, color: Color, )
Push a thick, filled line segment.
Sourcepub fn push_line_dashed(
&mut self,
from: Point,
to: Point,
dash_len: f32,
gap_len: f32,
color: Color,
)
pub fn push_line_dashed( &mut self, from: Point, to: Point, dash_len: f32, gap_len: f32, color: Color, )
Push a dashed line segment.
Sourcepub fn push_stroke_path(
&mut self,
path: PathData,
style: StrokeStyle,
color: Color,
)
pub fn push_stroke_path( &mut self, path: PathData, style: StrokeStyle, color: Color, )
Push a stroked path.
Sourcepub fn push_gradient_linear(
&mut self,
rect: Rect,
start: Point,
end: Point,
stops: Vec<GradientStop>,
)
pub fn push_gradient_linear( &mut self, rect: Rect, start: Point, end: Point, stops: Vec<GradientStop>, )
Push a linear gradient fill over rect.
Sourcepub fn push_gradient_radial(
&mut self,
rect: Rect,
center: Point,
radius: f32,
stops: Vec<GradientStop>,
)
pub fn push_gradient_radial( &mut self, rect: Rect, center: Point, radius: f32, stops: Vec<GradientStop>, )
Push a radial gradient fill over rect.
Sourcepub fn push_image(&mut self, image: ImageData, dest: Rect, filter: ImageFilter)
pub fn push_image(&mut self, image: ImageData, dest: Rect, filter: ImageFilter)
Push a scaled image blit.
Sourcepub fn push_nine_slice(
&mut self,
image: ImageData,
dest: Rect,
insets: [u32; 4],
)
pub fn push_nine_slice( &mut self, image: ImageData, dest: Rect, insets: [u32; 4], )
Push a 9-slice scaled image.