pub struct PresentStats {
pub buffer_age: u8,
pub with_damage: bool,
pub bytes_copied: u64,
pub surface_width: u32,
pub surface_height: u32,
pub raster: Duration,
pub acquire: Duration,
pub present: Duration,
pub renderer: &'static str,
}Expand description
What the last present did.
The platform records one of these after every frame it presents and, when
the window was opened with a PresentStatsHandle, publishes it there for
the application to read.
Fields§
§buffer_age: u8The buffer age the platform reported, in presents.
An age of 0 means the buffer contents were unknown and the present copied the whole surface.
with_damage: boolWhether the present carried only the damaged region.
A present without damage copied and presented the whole surface.
bytes_copied: u64How many surface bytes the present copied from the renderer’s pixmap.
Four bytes per pixel, so a full present of a 100 by 100 surface copies 40,000 bytes. The GPU path reports none: it draws straight onto the window surface and copies no pixmap.
surface_width: u32The width of the presented surface in physical pixels.
surface_height: u32The height of the presented surface in physical pixels.
raster: DurationHow long the renderer took to paint this frame’s damage into its surface.
On the GPU path this is the whole draw, whose submission reaches the GPU asynchronously.
acquire: DurationHow long the platform waited for a free window buffer before the present could start.
A compositor that still holds the previous buffers makes this wait, often for up to one display refresh. It is time spent blocked, not work.
present: DurationHow long the present took, from holding a free window buffer to handing
it back to the platform: the copy and the submission, without the wait
that PresentStats::acquire holds.
renderer: &'static strWhich renderer presented the frame, as its name: cpu or gpu.
Empty until the first present.
Trait Implementations§
Source§impl Clone for PresentStats
impl Clone for PresentStats
impl Copy for PresentStats
Source§impl Debug for PresentStats
impl Debug for PresentStats
Source§impl Default for PresentStats
impl Default for PresentStats
impl Eq for PresentStats
Source§impl PartialEq for PresentStats
impl PartialEq for PresentStats
impl StructuralPartialEq for PresentStats
Auto Trait Implementations§
impl Freeze for PresentStats
impl RefUnwindSafe for PresentStats
impl Send for PresentStats
impl Sync for PresentStats
impl Unpin for PresentStats
impl UnsafeUnpin for PresentStats
impl UnwindSafe for PresentStats
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.