Skip to main content

PlanningScene

Struct PlanningScene 

Source
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§

Source§

impl PlanningScene

Source

pub fn new() -> Self

Source

pub fn finish(self) -> FramePlan

Trait Implementations§

Source§

impl Debug for PlanningScene

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PlanningScene

Source§

fn default() -> PlanningScene

Returns the “default value” for a type. Read more
Source§

impl PaintScene for PlanningScene

Source§

fn reset(&mut self)

Removes all content from the 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>>, )

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)

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 pop_layer(&mut self)

Pops the current layer.
Source§

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, )

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, )

Draws a run of glyphs
Source§

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)

Append a recorded Scene Fragment to the current scene
Source§

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 method
Source§

impl RenderContext for PlanningScene

Source§

fn try_register_custom_resource( &mut self, resource: Box<dyn Any>, ) -> Result<ResourceId, RegisterResourceError>

Source§

fn unregister_resource(&mut self, resource_id: ResourceId)

Source§

fn renderer_specific_context(&self) -> Option<Box<dyn Any>>

Return a type-erased context type that is passed to custom widgets in order to enable them to render renderer-specific content

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,