Struct SurfaceDamage
pub struct SurfaceDamage { /* private fields */ }Expand description
Where an app’s frames on a surface changed since its host last looked
(Self::take), decided as a window of its own decides what to submit:
the widgets’ damage and the tooltip’s bounds, unless something no damage
describes changed, which repaints the surface.
Implementations§
§impl SurfaceDamage
impl SurfaceDamage
pub fn copying() -> SurfaceDamage
pub fn copying() -> SurfaceDamage
For a host that presents each frame over the pixels of the last one
and makes the copies Self::take_copying returns before it repaints
the damage: a scroll then copies what stays on screen instead of
damaging its viewport (crate::scroll_copy).
pub fn is_copying(&self) -> bool
pub fn is_copying(&self) -> bool
Whether this is for a host that copies (Self::copying).
pub fn painting_peers(self) -> SurfaceDamage
pub fn painting_peers(self) -> SurfaceDamage
Paint collaborators’ pointers, names and activity over the widgets, as a window of its own does, and damage only the marks that changed; a scroll beneath them still copies, repainting the marks where they are and where its copy took them. For a host that does not paint them itself (an embedded app’s host does).
pub fn set_copy_scale(&mut self, device_per_unit: f64)
pub fn set_copy_scale(&mut self, device_per_unit: f64)
The host’s target has device_per_unit pixels per pixel of the
surface’s scene (an app drawn into a desktop’s logical scene shown at
200 % has 2): copies are planned in those pixels, so a step of half a
scene pixel there is a whole pixel and copies. The copies
Self::take_copying returns are in them.
pub fn copy_scale(&self) -> f64
pub fn copy_scale(&self) -> f64
How many pixels of the host’s target one pixel of the surface’s
scene is (Self::set_copy_scale).
pub fn take(&mut self) -> Option<Vec<Rect>>
pub fn take(&mut self) -> Option<Vec<Rect>>
Where the frames since the last take changed, or None when they
must be repainted whole. A copy is damage here: where it would land.
pub fn take_copying(&mut self) -> Option<(Vec<DeviceCopy>, Vec<Rect>)>
pub fn take_copying(&mut self) -> Option<(Vec<DeviceCopy>, Vec<Rect>)>
The copies to make, in order, and then where the frames since the
last take changed; None when they must be repainted whole.
Trait Implementations§
§impl Default for SurfaceDamage
impl Default for SurfaceDamage
§fn default() -> SurfaceDamage
fn default() -> SurfaceDamage
Auto Trait Implementations§
impl Freeze for SurfaceDamage
impl !RefUnwindSafe for SurfaceDamage
impl Send for SurfaceDamage
impl Sync for SurfaceDamage
impl Unpin for SurfaceDamage
impl UnsafeUnpin for SurfaceDamage
impl !UnwindSafe for SurfaceDamage
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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