Skip to main content

Target

Trait Target 

Source
pub trait Target {
    // Required methods
    fn draw(&mut self, draw: &Draw, t: Affine);
    fn push_clip(&mut self, path: &BezPath, t: Affine);
    fn push_layer(
        &mut self,
        blend: Blend,
        bounds: Option<&BezPath>,
        t: Affine,
        area: KRect,
    );
    fn pop(&mut self);
}
Expand description

What a backend does with the commands paint hands it, each already under the transform from its coordinates to the target’s pixels. A backend translates each into its library’s call and decides nothing.

Required Methods§

Source

fn draw(&mut self, draw: &Draw, t: Affine)

Paints draw under t.

Source

fn push_clip(&mut self, path: &BezPath, t: Affine)

Opens a clip to path under t.

Source

fn push_layer( &mut self, blend: Blend, bounds: Option<&BezPath>, t: Affine, area: KRect, )

A layer with blend, bounded by bounds under t — or, when None, by area, the whole of what is painted, in the target’s pixels.

Source

fn pop(&mut self)

Closes the last clip or layer opened.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Target for Cpu<'_>