Skip to main content

PictureLayer

Struct PictureLayer 

Source
pub struct PictureLayer {
    pub canvas_bounds: Rect,
    /* private fields */
}
Expand description

A composited layer containing a Picture.

Picture layers are always leaves in the layer tree. They are also responsible for disposing of the Picture object they hold. This is typically done when their parent and all RenderObjects that participated in painting the picture have been disposed.

Fields§

§canvas_bounds: Rect

The bounds that were used for the canvas that drew this layer’s picture.

This is purely advisory. It can help debug why certain drawing commands are being culled.

Implementations§

Source§

impl PictureLayer

Source

pub fn new(app: &mut App, canvas_bounds: Rect) -> Handle<PictureLayer>

Creates a leaf layer for the layer tree.

Source

pub fn picture(self: Handle<Self>, app: &App) -> Option<&Arc<Picture>>

The picture recorded for this layer.

The picture’s coordinate system matches this layer’s coordinate system.

Source

pub fn set_picture( self: Handle<Self>, app: &mut App, picture: Option<Arc<Picture>>, )

See picture. Dart’s _picture?.dispose() is the drop of the old one.

Source

pub fn is_complex_hint(self: Handle<Self>, app: &App) -> bool

Hints that the painting in this layer is complex and would benefit from caching.

If this hint is not set, the compositor will apply its own heuristics to decide whether the this layer is complex enough to benefit from caching.

Source

pub fn set_is_complex_hint(self: Handle<Self>, app: &mut App, value: bool)

Source

pub fn will_change_hint(self: Handle<Self>, app: &App) -> bool

Hints that the painting in this layer is likely to change next frame.

This hint tells the compositor not to cache this layer because the cache will not be used in the future. If this hint is not set, the compositor will apply its own heuristics to decide whether this layer is likely to be reused in the future.

Source

pub fn set_will_change_hint(self: Handle<Self>, app: &mut App, value: bool)

Trait Implementations§

Source§

impl Layer for PictureLayer

Source§

fn layer_data(self: Handle<Self>, app: &App) -> &LayerData

Dart’s base-class fields, held under the field layer ([layer_accessors!]).
Source§

fn layer_data_mut(self: Handle<Self>, app: &mut App) -> &mut LayerData

Source§

fn dispose(self: Handle<Self>, app: &mut App)

Clears any retained resources that this layer holds. Read more
Source§

fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)

Override this method to upload this layer to the engine.
Source§

fn find_annotations( self: Handle<Self>, _app: &App, _result: &mut AnnotationSearch, _local_position: Offset, _only_first: bool, ) -> bool

Search this layer and its subtree for annotations of the searched type at the location described by local_position. Read more
Source§

const AS_CONTAINER: Option<fn() -> &'static ContainerLayerVTable> = None

The container table when this type extends ContainerLayer; layer_accessors!(container) sets it. Dart’s layer is ContainerLayer.
Source§

fn supports_rasterization(self: Handle<Self>, app: &App) -> bool

Whether or not this layer, or any child layers, can be rasterized with Scene.toImage. Read more
Source§

fn describe_clip_bounds(self: Handle<Self>, app: &App) -> Option<Rect>

Describes the clip that would be applied to contents of this layer, if any.
Source§

fn always_needs_add_to_scene(self: Handle<Self>, app: &App) -> bool

Subclasses may override this to true to disable retained rendering.
Source§

fn attach(self: Handle<Self>, app: &mut App, owner: HandleId)

Mark this layer as attached to the given owner. Read more
Source§

fn detach(self: Handle<Self>, app: &mut App)

Mark this layer as detached from its owner. Read more
Source§

fn redepth_children(self: Handle<Self>, app: &mut App)

Adjust the depth of this node’s children, if any. Read more
Source§

fn fire_composition_callbacks( self: Handle<Self>, app: &mut App, include_children: bool, )

Dart’s _fireCompositionCallbacks; ContainerLayer recurses into its children.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> LayerBase for T
where T: Layer,

Source§

fn dispose(self: Handle<Self>, app: &mut App)

Layer.dispose.
Source§

fn attach(self: Handle<Self>, app: &mut App, owner: HandleId)

Layer.attach.
Source§

fn detach(self: Handle<Self>, app: &mut App)

Layer.detach.
Source§

fn fire_composition_callbacks( self: Handle<Self>, app: &mut App, include_children: bool, )

Layer._fireCompositionCallbacks.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>