Skip to main content

FrameReport

Struct FrameReport 

Source
pub struct FrameReport {
    pub frame_index: u64,
    pub paint_damage: FrameDamage,
    pub present_damage: FrameDamage,
    pub accumulated_paint_damage: FrameDamage,
    pub accumulated_present_damage: FrameDamage,
    pub frames_since_reset: u32,
    pub reset_generation: u64,
    pub relayout_iterations: u32,
    pub dom_regenerations: u32,
    pub hit_depth_cap: bool,
    pub terminal_result: u8,
}
Expand description

Per-frame observability record hung off LayoutWindow.

This is what makes damage + frame-work counters visible to an E2E assertion: CallbackInfo::get_layout_window().frame_report. The CPU backend writes paint_damage / present_damage / frame_index after every render_frame; the event loop writes the work counters.

The *_since_reset counters are STICKY: they are never cleared automatically (a per-tick reset would race the assertion that wants to read them). Use the reset_frame_counters debug op to zero them at a known point in a test.

Fields§

§frame_index: u64

Monotonic index of the last CPU-rendered frame.

§paint_damage: FrameDamage

PAINT damage of the last frame — the pixels actually re-rasterised.

§present_damage: FrameDamage

PRESENT damage of the last frame — the pixels that changed on screen (⊇ paint damage; a scroll memmoves a large region but paints a strip).

§accumulated_paint_damage: FrameDamage

UNION of the paint damage of every frame since the last counter reset.

This is what a test must assert on: between the step that changed something and the assertion, the engine may render further (idle) frames whose damage is None, which would clobber paint_damage. The accumulated damage is stable across those.

§accumulated_present_damage: FrameDamage

UNION of the present damage of every frame since the last counter reset.

§frames_since_reset: u32

Frames rendered since the last counter reset.

§reset_generation: u64

Generation of the last observed reset request (see request_frame_report_reset).

§relayout_iterations: u32

Highest process_window_events recursion depth reached since the last counter reset. > 1 means the frame did not converge in one pass.

§dom_regenerations: u32

Number of regenerate_layout() (i.e. layout_callback) runs since the last counter reset.

§hit_depth_cap: bool

true if MAX_EVENT_RECURSION_DEPTH was ever hit since the last reset. Today the engine only log_warns on this; this flag is what lets a test turn an invalidation loop into a red assertion instead of a silent cap.

§terminal_result: u8

The last terminal ProcessEventResult (as its u8 discriminant order).

Implementations§

Source§

impl FrameReport

Source

pub fn sync_generation(&mut self)

Zero the work counters + accumulated damage if a reset was requested. Called by every writer of the report before it writes.

Source

pub fn reset_counters(&mut self)

Zero the sticky work counters + accumulated damage.

Source

pub fn record_frame(&mut self, paint: FrameDamage, present: FrameDamage)

Record the damage of a freshly rendered frame: it becomes the last-frame damage AND is merged into the accumulated damage since the last reset.

Trait Implementations§

Source§

impl Clone for FrameReport

Source§

fn clone(&self) -> FrameReport

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FrameReport

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for FrameReport

Source§

fn default() -> FrameReport

Returns the “default value” for a type. Read more
Source§

impl PartialEq for FrameReport

Source§

fn eq(&self, other: &FrameReport) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FrameReport

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.