Skip to main content

DamageTracker

Struct DamageTracker 

Source
pub struct DamageTracker { /* private fields */ }

Implementations§

Source§

impl DamageTracker

Source

pub fn new() -> Self

Source

pub fn mark_rect(&mut self, rect: Rect)

Zaznacz konkretny obszar (window coords) jako brudny.

Source

pub fn mark_full(&mut self)

Cały viewport do przemalowania (resize, DPI, motyw, mount/unmount root).

Source

pub fn mark_layout(&mut self)

Zmiana wpłynie na pomiar/układ (nie tylko piksele).

Source

pub fn mark(&mut self, flags: Dirty)

Surowy mark (np. Dirty::OVERLAY, Dirty::CANVAS).

Source

pub fn request_frame(&mut self)

Wołane przez PaintCtx::request_frame() — “pomaluj mnie w następnej klatce”.

Source

pub fn take_motion(&mut self) -> bool

Zużywa request z poprzedniej klatki. Wołane raz na klatkę, PRZED paint.

Source

pub fn is_empty(&self) -> bool

No pixels or animation work are pending.

Bookkeeping-only flags (HIT_TEST, DATA) do not count as a frame.

Source

pub fn needs_frame(&self) -> bool

Source

pub fn needs_layout(&self) -> bool

Source

pub fn needs_paint(&self) -> bool

Source

pub fn flags(&self) -> Dirty

Source

pub fn paint_region(&self) -> Option<Rect>

Some(rect) = repaint only this area. None = full repaint.

Layout changes can move or remove children, so they always require a full repaint; a screen-space rect alone cannot describe that damage. The 2 px margin covers anti-aliasing; the renderer adds more headroom for shadows before using the region as a scissor.

This is the bounding box of paint_regions; use the individual regions when the backend supports multiple scissors.

Source

pub fn paint_regions(&self) -> Option<Vec<Rect>>

Some(regions) = repaint only these disjoint areas. None = full repaint.

Each region is inflated by 2 px for anti-aliasing. Regions that overlap are merged while marks accumulate; if more than the region cap remain, they collapse into one bounding box.

Source

pub fn after_paint(&mut self)

Wołane po paint — resetuje stan bieżącej klatki. NIE rusza motion_pending, bo paint mógł złożyć nowy request.

Source

pub fn record_skipped(&mut self)

Wołane gdy klatka pominięta.

Czyści też znaczniki księgowe (HIT_TEST, DATA), które nie wymagają pikseli, żeby nie utrzymywały needs_frame() w nieskończoność.

Source

pub fn clear_all(&mut self)

Pełny reset (nowy root, nowe okno).

Source

pub fn frames_painted(&self) -> u64

Source

pub fn frames_skipped(&self) -> u64

Source

pub fn skip_rate(&self) -> f32

Odsetek klatek pominiętych (0.0 – 1.0).

Trait Implementations§

Source§

impl Clone for DamageTracker

Source§

fn clone(&self) -> Self

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 DamageTracker

Source§

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

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

impl Default for DamageTracker

Source§

fn default() -> Self

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

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<T> ViewState for T
where T: Default + 'static,