use crate::atlas::{AtlasPaint, AtlasSlot};
use crate::color::{AlphaColor, Srgb};
use crate::kurbo::{Affine, BezPath, Rect};
use crate::peniko::BlendMode;
use vello_common::paint::{Image, ImageSource, Tint};
pub trait DrawSink {
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_clip_path(&mut self, clip: &BezPath) {
self.push_clip_layer(clip);
}
fn push_blend_layer(&mut self, blend_mode: BlendMode);
fn pop_layer(&mut self);
fn pop_clip_path(&mut self) {
self.pop_layer();
}
fn width(&self) -> u16;
fn height(&self) -> u16;
}
pub trait GlyphRenderer: DrawSink {
type SavedState;
fn save_state(&mut self) -> Self::SavedState;
fn restore_state(&mut self, state: Self::SavedState);
fn stroke_path(&mut self, path: &BezPath);
fn set_paint_image(&mut self, image: Image);
fn set_tint(&mut self, tint: Option<Tint>);
fn get_context_color(&self) -> AlphaColor<Srgb>;
fn atlas_image_source(&self, atlas_slot: &AtlasSlot) -> ImageSource;
fn atlas_paint_transform(&self, atlas_slot: &AtlasSlot) -> Affine;
}