Struct LayerPresenter
pub struct LayerPresenter { /* private fields */ }Expand description
The layer textures of one output and what they hold.
Implementations§
§impl LayerPresenter
impl LayerPresenter
pub fn can_present(cache: &FrameCache, size: (u32, u32)) -> bool
pub fn can_present(cache: &FrameCache, size: (u32, u32)) -> bool
Whether cache can be presented on an output of size: it has
strips, one drawing for each, on a canvas at least as wide.
pub fn present<R>(
&mut self,
raster: &mut R,
cache: &FrameCache,
revision: u64,
holds: Option<u64>,
) -> Result<(), <R as LayerRaster>::Error>where
R: LayerRaster,
pub fn present<R>(
&mut self,
raster: &mut R,
cache: &FrameCache,
revision: u64,
holds: Option<u64>,
) -> Result<(), <R as LayerRaster>::Error>where
R: LayerRaster,
Composite cache, frame revision, into the output: a strip pan
copies what stays on screen and rasterises only what it uncovered.
holds is the frame the output target holds now, when it holds a
complete one; only what changed since is composited when that is the
frame last composited from the layers.
§Errors
As the raster’s; a failure forgets what the layers hold, so the next frame rasterises them whole.
pub fn warm<R>(
&mut self,
raster: &mut R,
cache: &FrameCache,
keep_going: &dyn Fn() -> bool,
) -> Result<u64, <R as LayerRaster>::Error>where
R: LayerRaster,
pub fn warm<R>(
&mut self,
raster: &mut R,
cache: &FrameCache,
keep_going: &dyn Fn() -> bool,
) -> Result<u64, <R as LayerRaster>::Error>where
R: LayerRaster,
Bring the layer textures up to cache without compositing it: the
content at rest drawn as layers, so that the first frame of the next
pan copies and composites instead of rasterising every layer.
Rasterises only the layers that differ from what the textures hold, a
whole one in bands (warm_bands), and stops between two renders as
soon as keep_going says a frame waits, keeping what it finished.
The output is left alone. Returns the pixels rasterised.
§Errors
As the raster’s; a failure forgets what the layers hold.
pub fn kept(&mut self, previous: u64, revision: u64)
pub fn kept(&mut self, previous: u64, revision: u64)
The output went from previous to revision without a pixel
changing: layers it was composited from as previous are still what
it shows, so the next pan composites only what moves.
pub fn forget(&mut self)
pub fn forget(&mut self)
What the layer textures hold is no longer known (the colour the backdrop is rasterised over changed, or the renderer lost geometry): the next frame rasterises every layer.
pub fn holds_layers(&self) -> bool
pub fn holds_layers(&self) -> bool
Whether the layer textures hold every layer of some frame: then a frame drawn as layers composites from them, rasterising only what changed.
pub fn last_work(&self) -> Option<&LayerWork>
pub fn last_work(&self) -> Option<&LayerWork>
The work the latest Self::present planned.
pub fn last_pixels(&self, size: (u32, u32)) -> Option<(u64, u64)>
pub fn last_pixels(&self, size: (u32, u32)) -> Option<(u64, u64)>
The pixels the latest Self::present rasterised and composited,
on an output of size, for counters.
Trait Implementations§
§impl Default for LayerPresenter
impl Default for LayerPresenter
§fn default() -> LayerPresenter
fn default() -> LayerPresenter
Auto Trait Implementations§
impl Freeze for LayerPresenter
impl !RefUnwindSafe for LayerPresenter
impl Send for LayerPresenter
impl Sync for LayerPresenter
impl Unpin for LayerPresenter
impl UnsafeUnpin for LayerPresenter
impl !UnwindSafe for LayerPresenter
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more