pub struct Scene {
pub tolerance: f64,
pub commands: Vec<RenderCommand>,
}Expand description
A recording of a Scene or Scene Fragment stored as plain data types that can be stored and passed around.
Fields§
§tolerance: f64§commands: Vec<RenderCommand>Implementations§
Trait Implementations§
Source§impl PaintScene for Scene
impl PaintScene for Scene
Source§fn push_layer(
&mut self,
blend: impl Into<BlendMode>,
alpha: f32,
transform: Affine,
clip: &impl Shape,
filter: Option<Arc<Filter>>,
backdrop_filter: Option<Arc<Filter>>,
)
fn push_layer( &mut self, blend: impl Into<BlendMode>, alpha: f32, transform: Affine, clip: &impl Shape, filter: Option<Arc<Filter>>, backdrop_filter: Option<Arc<Filter>>, )
Pushes a new layer clipped by the specified shape and composed with previous layers using the specified blend mode.
Every drawing command after this call will be clipped by the shape until the layer is popped.
However, the transforms are not saved or modified by the layer stack.
Source§fn push_clip_layer(&mut self, transform: Affine, clip: &impl Shape)
fn push_clip_layer(&mut self, transform: Affine, clip: &impl Shape)
Pushes a new clip layer clipped by the specified shape.
Every drawing command after this call will be clipped by the shape until the layer is popped.
However, the transforms are not saved or modified by the layer stack.
Source§fn stroke<'a>(
&mut self,
style: &Stroke,
transform: Affine,
paint_ref: impl Into<PaintRef<'a>>,
brush_transform: Option<Affine>,
shape: &impl Shape,
)
fn stroke<'a>( &mut self, style: &Stroke, transform: Affine, paint_ref: impl Into<PaintRef<'a>>, brush_transform: Option<Affine>, shape: &impl Shape, )
Strokes a shape using the specified style and brush.
Source§fn fill<'a>(
&mut self,
style: Fill,
transform: Affine,
paint: impl Into<PaintRef<'a>>,
brush_transform: Option<Affine>,
shape: &impl Shape,
)
fn fill<'a>( &mut self, style: Fill, transform: Affine, paint: impl Into<PaintRef<'a>>, brush_transform: Option<Affine>, shape: &impl Shape, )
Fills a shape using the specified style and brush.
Source§fn draw_glyphs<'a, 's: 'a>(
&'a mut self,
font: &'a FontData,
font_size: f32,
hint: bool,
normalized_coords: &'a [NormalizedCoord],
embolden: Vec2,
style: impl Into<StyleRef<'a>>,
paint_ref: impl Into<PaintRef<'a>>,
brush_alpha: f32,
transform: Affine,
glyph_transform: Option<Affine>,
glyphs: impl Iterator<Item = Glyph>,
)
fn draw_glyphs<'a, 's: 'a>( &'a mut self, font: &'a FontData, font_size: f32, hint: bool, normalized_coords: &'a [NormalizedCoord], embolden: Vec2, style: impl Into<StyleRef<'a>>, paint_ref: impl Into<PaintRef<'a>>, brush_alpha: f32, transform: Affine, glyph_transform: Option<Affine>, glyphs: impl Iterator<Item = Glyph>, )
Draws a run of glyphs
Source§fn draw_box_shadow(
&mut self,
transform: Affine,
rect: Rect,
brush: Color,
radius: f64,
std_dev: f64,
)
fn draw_box_shadow( &mut self, transform: Affine, rect: Rect, brush: Color, radius: f64, std_dev: f64, )
Draw a rounded rectangle blurred with a gaussian filter.
Source§fn append_scene(&mut self, scene: Scene, scene_transform: Affine)
fn append_scene(&mut self, scene: Scene, scene_transform: Affine)
Append a recorded Scene Fragment to the current scene
Source§fn draw_image(&mut self, image: ImageBrushRef<'_>, transform: Affine)
fn draw_image(&mut self, image: ImageBrushRef<'_>, transform: Affine)
Utility method to draw an image at it’s natural size. For more advanced image drawing use the
fill methodSource§impl RenderContext for Scene
impl RenderContext for Scene
fn try_register_custom_resource( &mut self, resource: Box<dyn Any>, ) -> Result<ResourceId, RegisterResourceError>
fn unregister_resource(&mut self, resource_id: ResourceId)
impl StructuralPartialEq for Scene
Auto Trait Implementations§
impl !RefUnwindSafe for Scene
impl !UnwindSafe for Scene
impl Freeze for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl UnsafeUnpin for Scene
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more