pub struct DamageTracker { /* private fields */ }Implementations§
Source§impl DamageTracker
impl DamageTracker
pub fn new() -> Self
Sourcepub fn mark_full(&mut self)
pub fn mark_full(&mut self)
Cały viewport do przemalowania (resize, DPI, motyw, mount/unmount root).
Sourcepub fn mark_layout(&mut self)
pub fn mark_layout(&mut self)
Zmiana wpłynie na pomiar/układ (nie tylko piksele).
Sourcepub fn request_frame(&mut self)
pub fn request_frame(&mut self)
Wołane przez PaintCtx::request_frame() — “pomaluj mnie w następnej klatce”.
Sourcepub fn take_motion(&mut self) -> bool
pub fn take_motion(&mut self) -> bool
Zużywa request z poprzedniej klatki. Wołane raz na klatkę, PRZED paint.
Sourcepub fn is_empty(&self) -> bool
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.
pub fn needs_frame(&self) -> bool
pub fn needs_layout(&self) -> bool
pub fn needs_paint(&self) -> bool
pub fn flags(&self) -> Dirty
Sourcepub fn paint_region(&self) -> Option<Rect>
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.
Sourcepub fn paint_regions(&self) -> Option<Vec<Rect>>
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.
Sourcepub fn after_paint(&mut self)
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.
Sourcepub fn record_skipped(&mut self)
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ść.