DisplayListBuilder

Trait DisplayListBuilder 

Source
pub trait DisplayListBuilder: 'static {
    type DisplayList: DisplayList;
    type ImageFilterFragment: ImageFilterFragment;
    type Paint: Paint;
    type ParagraphBuilder: ParagraphBuilder;
    type PathBuilder: PathBuilder;
    type Texture: Texture;

Show 31 methods // Required methods fn new(bounds: impl Into<Option<PixelRect>>) -> Self; fn scale(&mut self, x_scale: f32, y_scale: f32); fn rotate(&mut self, angle_degrees: f32); fn translate(&mut self, x_translation: f32, y_translation: f32); fn transform(&mut self, transform: &Matrix); fn set_transform(&mut self, transform: &Matrix); fn get_transform(&self) -> Matrix; fn reset_transform(&mut self); fn clip_rect( &mut self, rect: impl Into<PixelRect>, operation: ClipOperation, ); fn clip_oval( &mut self, oval_bounds: impl Into<PixelRect>, operation: ClipOperation, ); fn clip_rounded_rect<'a>( &mut self, rect: impl Into<PixelRect>, radii: impl Into<OptRef<'a, RoundingRadii>>, operation: ClipOperation, ); fn clip_path( &mut self, path: &<Self::PathBuilder as PathBuilder>::Path, operation: ClipOperation, ); fn save(&mut self); fn save_layer<'a>( &mut self, bounds: impl Into<PixelRect>, paint: impl Into<Option<OptRef<'a, Self::Paint>>>, filter: Option<ImageFilter<Self::ImageFilterFragment>>, ) where <Self as DisplayListBuilder>::Paint: 'a; fn get_save_count(&mut self) -> usize; fn restore(&mut self); fn draw_paint<'a>(&mut self, paint: impl Into<OptRef<'a, Self::Paint>>) where <Self as DisplayListBuilder>::Paint: 'a; fn draw_line<'a>( &mut self, from: impl Into<PixelPoint>, to: impl Into<PixelPoint>, paint: impl Into<OptRef<'a, Self::Paint>>, ) where <Self as DisplayListBuilder>::Paint: 'a; fn draw_dashed_line<'a>( &mut self, from: impl Into<PixelPoint>, to: impl Into<PixelPoint>, on_length: f32, off_length: f32, paint: impl Into<OptRef<'a, Self::Paint>>, ) where <Self as DisplayListBuilder>::Paint: 'a; fn draw_rect<'a>( &mut self, rect: impl Into<PixelRect>, paint: impl Into<OptRef<'a, Self::Paint>>, ) where <Self as DisplayListBuilder>::Paint: 'a; fn draw_rounded_rect<'a>( &mut self, rect: impl Into<PixelRect>, radii: impl Into<OptRef<'a, RoundingRadii>>, paint: impl Into<OptRef<'a, Self::Paint>>, ) where <Self as DisplayListBuilder>::Paint: 'a; fn draw_rounded_rect_difference<'a>( &mut self, outer_rect: impl Into<PixelRect>, outer_radii: impl Into<OptRef<'a, RoundingRadii>>, inner_rect: impl Into<PixelRect>, inner_radii: impl Into<OptRef<'a, RoundingRadii>>, paint: impl Into<OptRef<'a, Self::Paint>>, ) where <Self as DisplayListBuilder>::Paint: 'a; fn draw_oval<'a>( &mut self, oval_bounds: impl Into<PixelRect>, paint: impl Into<OptRef<'a, Self::Paint>>, ) where <Self as DisplayListBuilder>::Paint: 'a; fn draw_path<'a>( &mut self, path: &<Self::PathBuilder as PathBuilder>::Path, paint: impl Into<OptRef<'a, Self::Paint>>, ) where <Self as DisplayListBuilder>::Paint: 'a; fn draw_shadow( &mut self, path: &<Self::PathBuilder as PathBuilder>::Path, color: impl Into<Color>, elevation: f32, oocluder_is_transparent: bool, device_pixel_ratio: f32, ); fn draw_texture_rect<'a>( &mut self, texture: &Self::Texture, src_rect: impl Into<PixelRect>, dst_rect: impl Into<PixelRect>, sampling: TextureSampling, paint: impl Into<Option<OptRef<'a, Self::Paint>>>, ) where <Self as DisplayListBuilder>::Paint: 'a; fn draw_texture<'a>( &mut self, texture: &Self::Texture, point: impl Into<PixelPoint>, sampling: TextureSampling, paint: impl Into<Option<OptRef<'a, Self::Paint>>>, ) where <Self as DisplayListBuilder>::Paint: 'a; fn draw_paragraph( &mut self, location: impl Into<PixelPoint>, paragraph: &<Self::ParagraphBuilder as ParagraphBuilder>::Paragraph, ); fn draw_display_list( &mut self, display_list: &Self::DisplayList, opacity: f32, ); fn build(self) -> Result<Self::DisplayList, &'static str>; // Provided method fn restore_to_count(&mut self, count: usize) { ... }
}

Required Associated Types§

Required Methods§

Source

fn new(bounds: impl Into<Option<PixelRect>>) -> Self

Create a new display list builder. An optional cull rectangle may be specified.

Source

fn scale(&mut self, x_scale: f32, y_scale: f32)

Apply a scale to the transformation matrix currently on top of the save stack.

Source

fn rotate(&mut self, angle_degrees: f32)

Apply a scale to the transformation matrix currently on top of the save stack.

Source

fn translate(&mut self, x_translation: f32, y_translation: f32)

Apply a translation to the transformation matrix currently on top of the save stack.

Source

fn transform(&mut self, transform: &Matrix)

Appends the the provided transformation to the transformation already on the save stack.

Source

fn set_transform(&mut self, transform: &Matrix)

Clear the transformation on top of the save stack and replace it with a new value.

Source

fn get_transform(&self) -> Matrix

Get the transformation currently built up on the top of the transformation stack.

Source

fn reset_transform(&mut self)

Reset the transformation on top of the transformation stack to identity.

Source

fn clip_rect(&mut self, rect: impl Into<PixelRect>, operation: ClipOperation)

Reduces the clip region to the intersection of the current clip and the given rectangle taking into account the clip operation.

Source

fn clip_oval( &mut self, oval_bounds: impl Into<PixelRect>, operation: ClipOperation, )

Reduces the clip region to the intersection of the current clip and the given oval taking into account the clip operation.

Source

fn clip_rounded_rect<'a>( &mut self, rect: impl Into<PixelRect>, radii: impl Into<OptRef<'a, RoundingRadii>>, operation: ClipOperation, )

Reduces the clip region to the intersection of the current clip and the given rounded rectangle taking into account the clip operation.

Source

fn clip_path( &mut self, path: &<Self::PathBuilder as PathBuilder>::Path, operation: ClipOperation, )

Reduces the clip region to the intersection of the current clip and the given path taking into account the clip operation.

Source

fn save(&mut self)

Stashes the current transformation and clip state onto a save stack.

Source

fn save_layer<'a>( &mut self, bounds: impl Into<PixelRect>, paint: impl Into<Option<OptRef<'a, Self::Paint>>>, filter: Option<ImageFilter<Self::ImageFilterFragment>>, )
where <Self as DisplayListBuilder>::Paint: 'a,

Stashes the current transformation and clip state onto a save stack and creates and creates an offscreen layer onto which subsequent rendering intent will be directed to.

Source

fn get_save_count(&mut self) -> usize

Gets the current size of the save stack.

Source

fn restore(&mut self)

Pops the last entry pushed onto the save stack using a call to Self::save or Self::save_layer.

Source

fn draw_paint<'a>(&mut self, paint: impl Into<OptRef<'a, Self::Paint>>)
where <Self as DisplayListBuilder>::Paint: 'a,

Fills the current clip with the specified paint.

Source

fn draw_line<'a>( &mut self, from: impl Into<PixelPoint>, to: impl Into<PixelPoint>, paint: impl Into<OptRef<'a, Self::Paint>>, )
where <Self as DisplayListBuilder>::Paint: 'a,

Draws a line segment.

Source

fn draw_dashed_line<'a>( &mut self, from: impl Into<PixelPoint>, to: impl Into<PixelPoint>, on_length: f32, off_length: f32, paint: impl Into<OptRef<'a, Self::Paint>>, )
where <Self as DisplayListBuilder>::Paint: 'a,

Draws a dash line segment.

Source

fn draw_rect<'a>( &mut self, rect: impl Into<PixelRect>, paint: impl Into<OptRef<'a, Self::Paint>>, )
where <Self as DisplayListBuilder>::Paint: 'a,

Draws a rectangle.

Source

fn draw_rounded_rect<'a>( &mut self, rect: impl Into<PixelRect>, radii: impl Into<OptRef<'a, RoundingRadii>>, paint: impl Into<OptRef<'a, Self::Paint>>, )
where <Self as DisplayListBuilder>::Paint: 'a,

Draws a rounded rectangle.

Source

fn draw_rounded_rect_difference<'a>( &mut self, outer_rect: impl Into<PixelRect>, outer_radii: impl Into<OptRef<'a, RoundingRadii>>, inner_rect: impl Into<PixelRect>, inner_radii: impl Into<OptRef<'a, RoundingRadii>>, paint: impl Into<OptRef<'a, Self::Paint>>, )
where <Self as DisplayListBuilder>::Paint: 'a,

Draws a shape that is the different between the specified rectangles.

Source

fn draw_oval<'a>( &mut self, oval_bounds: impl Into<PixelRect>, paint: impl Into<OptRef<'a, Self::Paint>>, )
where <Self as DisplayListBuilder>::Paint: 'a,

Draws an oval.

Source

fn draw_path<'a>( &mut self, path: &<Self::PathBuilder as PathBuilder>::Path, paint: impl Into<OptRef<'a, Self::Paint>>, )
where <Self as DisplayListBuilder>::Paint: 'a,

Draws a path.

Source

fn draw_shadow( &mut self, path: &<Self::PathBuilder as PathBuilder>::Path, color: impl Into<Color>, elevation: f32, oocluder_is_transparent: bool, device_pixel_ratio: f32, )

Draws a shadow for a Path given a material elevation.

Source

fn draw_texture_rect<'a>( &mut self, texture: &Self::Texture, src_rect: impl Into<PixelRect>, dst_rect: impl Into<PixelRect>, sampling: TextureSampling, paint: impl Into<Option<OptRef<'a, Self::Paint>>>, )
where <Self as DisplayListBuilder>::Paint: 'a,

Draw a portion of texture at the specified location.

Source

fn draw_texture<'a>( &mut self, texture: &Self::Texture, point: impl Into<PixelPoint>, sampling: TextureSampling, paint: impl Into<Option<OptRef<'a, Self::Paint>>>, )
where <Self as DisplayListBuilder>::Paint: 'a,

Draws a texture at the specified point.

Source

fn draw_paragraph( &mut self, location: impl Into<PixelPoint>, paragraph: &<Self::ParagraphBuilder as ParagraphBuilder>::Paragraph, )

Draws a paragraph at the specified location.

Source

fn draw_display_list(&mut self, display_list: &Self::DisplayList, opacity: f32)

Draws another display list.

Source

fn build(self) -> Result<Self::DisplayList, &'static str>

Builds display list.

Provided Methods§

Source

fn restore_to_count(&mut self, count: usize)

Effectively calls restore till the size of the save stack becomes a specified count.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§