hayro_interpret/
device.rs1use crate::font::Glyph;
2use crate::soft_mask::SoftMask;
3use crate::{ClipPath, Image};
4use crate::{GlyphDrawMode, Paint, PathDrawMode};
5use kurbo::{Affine, BezPath};
6
7pub trait Device<'a> {
9 fn set_soft_mask(&mut self, mask: Option<SoftMask<'a>>);
12 fn draw_path(
14 &mut self,
15 path: &BezPath,
16 transform: Affine,
17 paint: &Paint<'a>,
18 draw_mode: &PathDrawMode,
19 );
20 fn push_clip_path(&mut self, clip_path: &ClipPath);
22 fn push_transparency_group(&mut self, opacity: f32, mask: Option<SoftMask<'a>>);
24 fn draw_glyph(
26 &mut self,
27 glyph: &Glyph<'a>,
28 transform: Affine,
29 glyph_transform: Affine,
30 paint: &Paint<'a>,
31 draw_mode: &GlyphDrawMode,
33 );
34 fn draw_image(&mut self, image: Image<'a, '_>, transform: Affine);
36 fn pop_clip_path(&mut self);
38 fn pop_transparency_group(&mut self);
40}