pub trait DrawSink {
// Required methods
fn set_transform(&mut self, t: Affine);
fn set_paint(&mut self, paint: AtlasPaint);
fn set_paint_transform(&mut self, t: Affine);
fn fill_path(&mut self, path: &BezPath);
fn fill_rect(&mut self, rect: &Rect);
fn push_clip_layer(&mut self, clip: &BezPath);
fn push_blend_layer(&mut self, blend_mode: BlendMode);
fn pop_layer(&mut self);
fn width(&self) -> u16;
fn height(&self) -> u16;
// Provided methods
fn push_clip_path(&mut self, clip: &BezPath) { ... }
fn pop_clip_path(&mut self) { ... }
}Expand description
A sink for low-level glyph drawing commands.
Required Methods§
Sourcefn set_transform(&mut self, t: Affine)
fn set_transform(&mut self, t: Affine)
Set the current transform.
Sourcefn set_paint(&mut self, paint: AtlasPaint)
fn set_paint(&mut self, paint: AtlasPaint)
Set the current paint.
Sourcefn set_paint_transform(&mut self, t: Affine)
fn set_paint_transform(&mut self, t: Affine)
Set the paint transform.
Sourcefn push_clip_layer(&mut self, clip: &BezPath)
fn push_clip_layer(&mut self, clip: &BezPath)
Push a clip layer defined by a path.
Sourcefn push_blend_layer(&mut self, blend_mode: BlendMode)
fn push_blend_layer(&mut self, blend_mode: BlendMode)
Push a blend/compositing layer.
Provided Methods§
Sourcefn push_clip_path(&mut self, clip: &BezPath)
fn push_clip_path(&mut self, clip: &BezPath)
Push a clip path.
This method can be implemented in terms of push_clip_layer without losing correctness.
However, clients are allowed to choose a more efficient clipping implementation that
doesn’t require pushing an isolated layer.
When providing a custom implementation of this method, the pop_clip_path method also
needs to be overridden correspondingly.
Sourcefn pop_clip_path(&mut self)
fn pop_clip_path(&mut self)
Pop the most recent clip path.
See the documentation for DrawSink::push_clip_path.