pub struct PaintDamage {
pub generation: u64,
pub layout_generation: u64,
/* private fields */
}Expand description
The regions of the document whose pixels differ from the previous frame.
Coordinates are document space: CSS pixels, with ancestor scroll offsets already applied, and without the paint scale or the viewport offset. A consumer working in device pixels multiplies by the scale it painted at.
Fields§
§generation: u64Bumped once per resolve that found anything at all.
Cheaper than the regions for the coarse question. A consumer that only wants “is this the same frame as last time” compares this and never looks at the rectangles.
layout_generation: u64Bumped once per resolve whose final box geometry differs from the previous resolved frame.
Unlike generation, repaint-only changes such as a
colour update leave this counter alone. Debug and cache consumers can
therefore distinguish layout changes from paint changes without
treating observation itself as a mutation.
Implementations§
Source§impl PaintDamage
impl PaintDamage
Sourcepub fn regions(&self) -> &[Rect]
pub fn regions(&self) -> &[Rect]
The changed rectangles, in no particular order and possibly overlapping.
Sourcepub fn intersects(&self, region: Rect) -> bool
pub fn intersects(&self, region: Rect) -> bool
Whether any of it lands in region.
The question a cache asks: given the area a filter reads from, is what
it read last time still valid? Touching edges do not count, for the same
reason they do not in the backdrop planner: a change ending at x1 and
a read starting at x1 share no pixel.
Trait Implementations§
Source§impl Clone for PaintDamage
impl Clone for PaintDamage
Source§fn clone(&self) -> PaintDamage
fn clone(&self) -> PaintDamage
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 PaintDamage
impl Debug for PaintDamage
Source§impl Default for PaintDamage
impl Default for PaintDamage
Source§fn default() -> PaintDamage
fn default() -> PaintDamage
Auto Trait Implementations§
impl Freeze for PaintDamage
impl RefUnwindSafe for PaintDamage
impl Send for PaintDamage
impl Sync for PaintDamage
impl Unpin for PaintDamage
impl UnsafeUnpin for PaintDamage
impl UnwindSafe for PaintDamage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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