Skip to main content

SceneLayer

Struct SceneLayer 

Source
pub struct SceneLayer { /* private fields */ }
Expand description

A layer’s live scene state.

Implementations§

Source§

impl SceneLayer

Source

pub fn source(&self) -> &dyn LayerBufferSource

The buffer source. The scene keeps ownership.

Source

pub fn source_mut(&mut self) -> &mut dyn LayerBufferSource

The buffer source, mutably — for painting into it, not for replacing it.

Source

pub const fn display(&self) -> &DisplayParams

How this layer is displayed.

Source

pub const fn set_display(&mut self, display: DisplayParams)

Change how this layer is displayed.

Geometry only affects the values written to whatever plane the layer already has, so this does not drop the warm start.

Source

pub const fn is_force_composited(&self) -> bool

Whether this layer is forced through composition.

Source

pub const fn set_force_composited(&mut self, force: bool)

Force this layer through composition rather than onto its own plane.

Flags for re-allocation: it changes what the allocator will consider, and therefore what is left for every other layer.

Source

pub const fn identity_tag(&self) -> Option<u64>

The caller’s identity for this layer, if it set one.

Source

pub const fn set_identity_tag(&mut self, tag: Option<u64>)

Label this layer with a caller-chosen identity.

Purely for the caller’s own lookups — see identity_tag. The scene never interprets it, and does not require it to be unique; a duplicate simply means find_by_identity_tag answers with the first match.

Source

pub const fn pinned_plane(&self) -> Option<u32>

The plane this layer is pinned to, if any.

Source

pub const fn set_pinned_plane(&mut self, plane_id: Option<u32>)

Pin this layer to a plane, or clear the pin with None.

For a caller that needs a specific plane rather than whichever one the allocator picks: a driver-bound producer, a plane with hardware the others lack, or a layout the caller has already validated. Honored where it can be, reported where it cannot — see pinned_plane.

Flags for re-allocation, because it changes where this layer goes and therefore what is left for everything else.

Source

pub const fn content_type(&self) -> ContentType

The allocator’s content-type hint.

Source

pub const fn set_content_type(&mut self, content_type: ContentType)

Change the content-type hint.

Unlike the display setters this changes plane scoring, so it also flags the layer for re-allocation: the scene drops the warm start that frame and lets the layer move to a plane its new hint prefers.

Source

pub const fn update_hint_hz(&self) -> u32

The producer’s expected refresh rate, or 0.

Source

pub const fn set_update_hint(&mut self, hz: u32)

Change the refresh-rate hint. Flags for re-allocation, as above.

Source

pub const fn app_priority(&self) -> u8

The application’s placement priority within a content class.

Source

pub const fn set_app_priority(&mut self, priority: u8)

Change the placement priority. Flags for re-allocation, as above.

Source

pub const fn hints_dirty(&self) -> bool

Whether a hint changed since the last commit.

Trait Implementations§

Source§

impl Debug for SceneLayer

Source§

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

Formats the value using the given formatter. Read more

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 = !

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.