Trait canvas::canvas_data::Backend

source ·
pub trait Backend {
    // Required methods
    fn get_composition_op(&self, opts: &DrawOptions) -> CompositionOp;
    fn need_to_draw_shadow(&self, color: &Color) -> bool;
    fn set_shadow_color(
        &mut self,
        color: AbsoluteColor,
        state: &mut CanvasPaintState<'_>,
    );
    fn set_fill_style(
        &mut self,
        style: FillOrStrokeStyle,
        state: &mut CanvasPaintState<'_>,
        drawtarget: &dyn GenericDrawTarget,
    );
    fn set_stroke_style(
        &mut self,
        style: FillOrStrokeStyle,
        state: &mut CanvasPaintState<'_>,
        drawtarget: &dyn GenericDrawTarget,
    );
    fn set_global_composition(
        &mut self,
        op: CompositionOrBlending,
        state: &mut CanvasPaintState<'_>,
    );
    fn create_drawtarget(&self, size: Size2D<u64>) -> Box<dyn GenericDrawTarget>;
    fn recreate_paint_state<'a>(
        &self,
        state: &CanvasPaintState<'a>,
    ) -> CanvasPaintState<'a>;
}

Required Methods§

source

fn get_composition_op(&self, opts: &DrawOptions) -> CompositionOp

source

fn need_to_draw_shadow(&self, color: &Color) -> bool

source

fn set_shadow_color( &mut self, color: AbsoluteColor, state: &mut CanvasPaintState<'_>, )

source

fn set_fill_style( &mut self, style: FillOrStrokeStyle, state: &mut CanvasPaintState<'_>, drawtarget: &dyn GenericDrawTarget, )

source

fn set_stroke_style( &mut self, style: FillOrStrokeStyle, state: &mut CanvasPaintState<'_>, drawtarget: &dyn GenericDrawTarget, )

source

fn set_global_composition( &mut self, op: CompositionOrBlending, state: &mut CanvasPaintState<'_>, )

source

fn create_drawtarget(&self, size: Size2D<u64>) -> Box<dyn GenericDrawTarget>

source

fn recreate_paint_state<'a>( &self, state: &CanvasPaintState<'a>, ) -> CanvasPaintState<'a>

Implementors§