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§
type DisplayList: DisplayList
type ImageFilterFragment: ImageFilterFragment
type Paint: Paint
type ParagraphBuilder: ParagraphBuilder
type PathBuilder: PathBuilder
type Texture: Texture
Required Methods§
Sourcefn new(bounds: impl Into<Option<PixelRect>>) -> Self
fn new(bounds: impl Into<Option<PixelRect>>) -> Self
Create a new display list builder. An optional cull rectangle may be specified.
Sourcefn scale(&mut self, x_scale: f32, y_scale: f32)
fn scale(&mut self, x_scale: f32, y_scale: f32)
Apply a scale to the transformation matrix currently on top of the save stack.
Sourcefn rotate(&mut self, angle_degrees: f32)
fn rotate(&mut self, angle_degrees: f32)
Apply a scale to the transformation matrix currently on top of the save stack.
Sourcefn translate(&mut self, x_translation: f32, y_translation: f32)
fn translate(&mut self, x_translation: f32, y_translation: f32)
Apply a translation to the transformation matrix currently on top of the save stack.
Sourcefn transform(&mut self, transform: &Matrix)
fn transform(&mut self, transform: &Matrix)
Appends the the provided transformation to the transformation already on the save stack.
Sourcefn set_transform(&mut self, transform: &Matrix)
fn set_transform(&mut self, transform: &Matrix)
Clear the transformation on top of the save stack and replace it with a new value.
Sourcefn get_transform(&self) -> Matrix
fn get_transform(&self) -> Matrix
Get the transformation currently built up on the top of the transformation stack.
Sourcefn reset_transform(&mut self)
fn reset_transform(&mut self)
Reset the transformation on top of the transformation stack to identity.
Sourcefn clip_rect(&mut self, rect: impl Into<PixelRect>, operation: ClipOperation)
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.
Sourcefn clip_oval(
&mut self,
oval_bounds: impl Into<PixelRect>,
operation: ClipOperation,
)
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.
Sourcefn clip_rounded_rect<'a>(
&mut self,
rect: impl Into<PixelRect>,
radii: impl Into<OptRef<'a, RoundingRadii>>,
operation: ClipOperation,
)
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.
Sourcefn clip_path(
&mut self,
path: &<Self::PathBuilder as PathBuilder>::Path,
operation: ClipOperation,
)
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.
Sourcefn 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 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.
Sourcefn get_save_count(&mut self) -> usize
fn get_save_count(&mut self) -> usize
Gets the current size of the save stack.
Sourcefn restore(&mut self)
fn restore(&mut self)
Pops the last entry pushed onto the save stack using a call to Self::save or Self::save_layer.
Sourcefn draw_paint<'a>(&mut self, paint: impl Into<OptRef<'a, Self::Paint>>)where
<Self as DisplayListBuilder>::Paint: 'a,
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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn draw_rect<'a>(
&mut self,
rect: impl Into<PixelRect>,
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,
Draws a rectangle.
Sourcefn 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<'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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn draw_paragraph(
&mut self,
location: impl Into<PixelPoint>,
paragraph: &<Self::ParagraphBuilder as ParagraphBuilder>::Paragraph,
)
fn draw_paragraph( &mut self, location: impl Into<PixelPoint>, paragraph: &<Self::ParagraphBuilder as ParagraphBuilder>::Paragraph, )
Draws a paragraph at the specified location.
Sourcefn draw_display_list(&mut self, display_list: &Self::DisplayList, opacity: f32)
fn draw_display_list(&mut self, display_list: &Self::DisplayList, opacity: f32)
Draws another display list.
Sourcefn build(self) -> Result<Self::DisplayList, &'static str>
fn build(self) -> Result<Self::DisplayList, &'static str>
Builds display list.
Provided Methods§
Sourcefn restore_to_count(&mut self, count: usize)
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.