Skip to main content

FrameDamage

Enum FrameDamage 

Source
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

Source

pub const fn is_none(&self) -> bool

true if no pixel was repainted at all.

Source

pub const fn is_full(&self) -> bool

true if the whole window was repainted.

Source

pub fn rect_count(&self) -> usize

Number of damage rects (None → 0, Full → 1).

Source

pub fn rects(&self) -> Option<&[LogicalRect]>

The damage rects, if this is an incremental repaint.

Source

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).

Source

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 → returns None: 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) — pass force_full = true there.
  • RectsSome(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, per DAMAGE_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

Source§

fn clone(&self) -> FrameDamage

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 FrameDamage

Source§

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

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

impl Default for FrameDamage

Source§

fn default() -> FrameDamage

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

impl PartialEq for FrameDamage

Source§

fn eq(&self, other: &FrameDamage) -> 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 FrameDamage

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.