Struct RetainedFrames
pub struct RetainedFrames { /* private fields */ }Expand description
The frame a host presented last, to compare the next with. Where a scene
drawn with damage parts (crate::scene_parts) changed is the parts
whose commands differ (or what a hinted part says changed); every other
pixel is drawn by the same commands as before. Anything that cannot be
proven (no parts, a change outside every part, another target) repaints
the whole frame.
Implementations§
§impl RetainedFrames
impl RetainedFrames
pub fn repaint(
&self,
scene: &Scene,
parts: Option<&SectionParts>,
key: TargetKey,
) -> Repaint
pub fn repaint( &self, scene: &Scene, parts: Option<&SectionParts>, key: TargetKey, ) -> Repaint
What to repaint of scene, drawn with parts, onto a target that
shows the frame last Self::presented.
pub fn presented(
&mut self,
scene: &Scene,
parts: Option<&SectionParts>,
key: TargetKey,
)
pub fn presented( &mut self, scene: &Scene, parts: Option<&SectionParts>, key: TargetKey, )
scene, drawn with parts, is what the target with key shows now.
pub fn shows_lost_geometry(&self, scratch: Scratch) -> bool
pub fn shows_lost_geometry(&self, scratch: Scratch) -> bool
Whether the renderer’s scratch is scratch without the target having
been brought up to date since it changed: a frame the target shows may
have geometry missing.
Either half of a scratch names the same renderer being short: a reservation that grew because a frame did not fit, or an overflow collected while the reservation was at its ceiling. The reservation changes as soon as the counters are collected, before the frame that dropped the geometry has been repainted whole for it, so a host that compares it here repaints again even when nothing was collected since.
pub fn note_scratch(&mut self, scratch: Scratch)
pub fn note_scratch(&mut self, scratch: Scratch)
The renderer’s scratch is scratch now: once it changed since the
target was brought up to date, the next frame repaints the whole
target. Pixels drawn with geometry missing stay on it otherwise, since
later frames repaint only what changes.
pub fn forget(&mut self)
pub fn forget(&mut self)
The target no longer shows the last frame presented.
pub const fn shows_frame(&self) -> bool
pub const fn shows_frame(&self) -> bool
Whether the target still holds the frame last presented: a host
that acquired a surface texture for a frame it then skipped puts
that on it again (crate::gpu::submit_target_to_surface) rather
than presenting a cleared one.
Trait Implementations§
§impl Default for RetainedFrames
impl Default for RetainedFrames
§fn default() -> RetainedFrames
fn default() -> RetainedFrames
Auto Trait Implementations§
impl Freeze for RetainedFrames
impl !RefUnwindSafe for RetainedFrames
impl Send for RetainedFrames
impl Sync for RetainedFrames
impl Unpin for RetainedFrames
impl UnsafeUnpin for RetainedFrames
impl !UnwindSafe for RetainedFrames
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