pub enum FrameDamage {
None,
Rects(Vec<LogicalRect>),
Full,
}Expand description
Outcome of a single CPU render_frame call — the seed of the unified
DamageRegion type described in DAMAGE_REGION_PLAN.md.
Lives in azul-layout (rather than in the dll’s headless backend, where it
was originally defined) so that it can be stored on LayoutWindow and
therefore be reachable from a CallbackInfo — i.e. from an E2E assertion.
dll::desktop::shell2::headless::FrameDamage is a re-export of this type.
Variants§
None
Nothing changed; render was skipped, the previous frame is still valid.
Rects(Vec<LogicalRect>)
Incremental repaint of exactly these logical rects.
Full
Full repaint (first frame, structural change, or shrink-resize).
Implementations§
Source§impl FrameDamage
impl FrameDamage
Sourcepub const fn rect_count(&self) -> usize
pub const fn rect_count(&self) -> usize
Number of damage rects (None → 0, Full → 1).
Sourcepub fn rects(&self) -> Option<&[LogicalRect]>
pub fn rects(&self) -> Option<&[LogicalRect]>
The damage rects, if this is an incremental repaint.
Sourcepub fn area(&self, window_area: f32) -> f32
pub fn area(&self, window_area: f32) -> f32
Total damaged area in logical px². None → 0.0, Full → the full
window_area passed in (the caller knows the window size).
Sourcepub fn to_present_rects_physical(
&self,
dpi_factor: f32,
buf_w: u32,
buf_h: u32,
force_full: bool,
) -> Option<Vec<(u32, u32, u32, u32)>>
pub fn to_present_rects_physical( &self, dpi_factor: f32, buf_w: u32, buf_h: u32, force_full: bool, ) -> Option<Vec<(u32, u32, u32, u32)>>
Convert this damage record into physical-pixel present rects for a
buf_w×buf_h buffer at dpi_factor — the ONE conversion every
platform presenter should use to hand damage to its compositor
(XPutImage sub-rects / wl_surface_damage / partial StretchDIBits
/ setNeedsDisplayInRect:).
None→ returnsNone: the previous frame is still on screen and valid — present nothing. Callers must STILL present in full when the OS asked for a re-present (Expose / WM_PAINT-from-uncover / drawRect) — passforce_full = truethere.Rects→Some(rects)as(x, y, w, h)physical px, rounded OUTWARD (floor origin / ceil far edge — truncation would under-cover fractional edges and leave 1px stale seams), clamped to the buffer. More than 16 rects collapses to one full-buffer rect (bounded cost, perDAMAGE_REGION_PLAN§3).Full→ one full-buffer rect.
“Present must never silently be empty when a present is required” —
when in doubt, callers should treat errors/unknowns as Full.
Trait Implementations§
Source§impl Clone for FrameDamage
impl Clone for FrameDamage
Source§fn clone(&self) -> FrameDamage
fn clone(&self) -> FrameDamage
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 FrameDamage
impl Debug for FrameDamage
Source§impl Default for FrameDamage
impl Default for FrameDamage
Source§fn default() -> FrameDamage
fn default() -> FrameDamage
impl Eq for FrameDamage
Source§impl PartialEq for FrameDamage
impl PartialEq for FrameDamage
impl StructuralPartialEq for FrameDamage
Auto Trait Implementations§
impl Freeze for FrameDamage
impl RefUnwindSafe for FrameDamage
impl Send for FrameDamage
impl Sync for FrameDamage
impl Unpin for FrameDamage
impl UnsafeUnpin for FrameDamage
impl UnwindSafe for FrameDamage
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<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.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