Skip to main content

MockLayer

Struct MockLayer 

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

A layer that shows nothing, and keeps what it shows now: the buffer presented last, as its current_picture, and the layers placed under it then; and how many pictures it was handed. Presents release their buffers at once.

Implementations§

Source§

impl MockLayer

Source

pub fn new(opaque: bool) -> MockLayer

A layer that has shown nothing yet.

Source

pub fn opaque(&self) -> bool

Whether the layer was made opaque.

Source

pub fn children(&self) -> Vec<(Arc<dyn CompositionLayer>, Placement)>

The layers placed under the picture the layer shows now, the bottom-most first, each where it is placed; none before its first picture.

Source

pub fn presents(&self) -> usize

How many pictures the layer was handed.

Source

pub fn of(layer: &dyn CompositionLayer) -> Option<&MockLayer>

The MockLayer a layer MockCompositor made is.

Trait Implementations§

Source§

impl CompositionLayer for MockLayer

Source§

fn present( &self, buffer: Arc<dyn HardwareBuffer>, children: Vec<(Arc<dyn CompositionLayer>, Placement)>, released: Box<dyn FnOnce() + Send + Sync>, )

Shows buffer, which fills the layer, and children beneath it, the bottom-most first, from the compositor’s next frame on, in one step, in place of what the layer showed: the buffers presented before, or a layer the system draws into, such as a player’s, whose picture goes nowhere then. A layer shows one source at a time, the last given it. Each child lies where its placement says in the buffer’s pixels, as a scene places a layer in its view’s, so the buffer’s own placement moves, clips and scales it with it. A child the last present showed and this one does not name is let go; a layer another parent holds is not shown here, and is reported. Read more
Source§

fn current_picture(&self) -> Option<LayerPicture>

What the layer shows now: the last buffer presented, or the current frame of the video or camera it shows. None while it shows nothing, and while it shows a layer the system draws into that the host does not read, such as one an app shows on it itself.

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

Source§

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

Source§

impl<T> WasmNotSendSync for T

Source§

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