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: u64Monotonic index of the last CPU-rendered frame.
paint_damage: FrameDamagePAINT damage of the last frame — the pixels actually re-rasterised.
present_damage: FrameDamagePRESENT 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: FrameDamageUNION 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: FrameDamageUNION of the present damage of every frame since the last counter reset.
frames_since_reset: u32Frames rendered since the last counter reset.
reset_generation: u64Generation of the last observed reset request (see request_frame_report_reset).
relayout_iterations: u32Highest process_window_events recursion depth reached since the last
counter reset. > 1 means the frame did not converge in one pass.
dom_regenerations: u32Number of regenerate_layout() (i.e. layout_callback) runs since the
last counter reset.
hit_depth_cap: booltrue 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: u8The last terminal ProcessEventResult (as its u8 discriminant order).
Implementations§
Source§impl FrameReport
impl FrameReport
Sourcepub fn sync_generation(&mut self)
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.
Sourcepub fn reset_counters(&mut self)
pub fn reset_counters(&mut self)
Zero the sticky work counters + accumulated damage.
Sourcepub fn record_frame(&mut self, paint: FrameDamage, present: FrameDamage)
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
impl Clone for FrameReport
Source§fn clone(&self) -> FrameReport
fn clone(&self) -> FrameReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FrameReport
impl Debug for FrameReport
Source§impl Default for FrameReport
impl Default for FrameReport
Source§fn default() -> FrameReport
fn default() -> FrameReport
Source§impl PartialEq for FrameReport
impl PartialEq for FrameReport
impl StructuralPartialEq for FrameReport
Auto Trait Implementations§
impl Freeze for FrameReport
impl RefUnwindSafe for FrameReport
impl Send for FrameReport
impl Sync for FrameReport
impl Unpin for FrameReport
impl UnsafeUnpin for FrameReport
impl UnwindSafe for FrameReport
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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