pub struct PlanningScene { /* private fields */ }Expand description
A PaintScene that draws nothing and only plans.
The point of it is that pass count is a property of the scene, not of the GPU. Painting a real document into this answers “how many passes does this page cost?” on a machine with no adapter, no surface and no window, which is what lets the six-panels-two-passes assertion run in CI instead of being a thing someone checks by eye on a laptop.
It is also the reference for how a backend should feed the planner: the order of the calls in here is the order a backend has to make them in.
Implementations§
Trait Implementations§
Source§impl Debug for PlanningScene
impl Debug for PlanningScene
Source§impl Default for PlanningScene
impl Default for PlanningScene
Source§fn default() -> PlanningScene
fn default() -> PlanningScene
Returns the “default value” for a type. Read more
Source§impl PaintScene for PlanningScene
impl PaintScene for PlanningScene
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,
_brush: impl Into<PaintRef<'a>>,
_brush_transform: Option<Affine>,
shape: &impl Shape,
)
fn stroke<'a>( &mut self, style: &Stroke, transform: Affine, _brush: 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,
_brush: impl Into<PaintRef<'a>>,
_brush_transform: Option<Affine>,
shape: &impl Shape,
)
fn fill<'a>( &mut self, _style: Fill, transform: Affine, _brush: 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>(
&'s mut self,
_font: &'a FontData,
font_size: f32,
_hint: bool,
_normalized_coords: &'a [NormalizedCoord],
_embolden: Vec2,
_style: impl Into<StyleRef<'a>>,
_brush: impl Into<PaintRef<'a>>,
_brush_alpha: f32,
transform: Affine,
_glyph_transform: Option<Affine>,
glyphs: impl Iterator<Item = Glyph> + Clone,
)
fn draw_glyphs<'a, 's: 'a>( &'s mut self, _font: &'a FontData, font_size: f32, _hint: bool, _normalized_coords: &'a [NormalizedCoord], _embolden: Vec2, _style: impl Into<StyleRef<'a>>, _brush: impl Into<PaintRef<'a>>, _brush_alpha: f32, transform: Affine, _glyph_transform: Option<Affine>, glyphs: impl Iterator<Item = Glyph> + Clone, )
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 PlanningScene
impl RenderContext for PlanningScene
fn try_register_custom_resource( &mut self, resource: Box<dyn Any>, ) -> Result<ResourceId, RegisterResourceError>
fn unregister_resource(&mut self, resource_id: ResourceId)
Auto Trait Implementations§
impl Freeze for PlanningScene
impl RefUnwindSafe for PlanningScene
impl Send for PlanningScene
impl Sync for PlanningScene
impl Unpin for PlanningScene
impl UnsafeUnpin for PlanningScene
impl UnwindSafe for PlanningScene
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