Struct smithay::wayland::compositor::SurfaceAttributes [−][src]
pub struct SurfaceAttributes { pub buffer: Option<BufferAssignment>, pub buffer_scale: i32, pub buffer_transform: Transform, pub opaque_region: Option<RegionAttributes>, pub input_region: Option<RegionAttributes>, pub damage: Vec<Damage>, pub frame_callbacks: Vec<WlCallback>, }
Expand description
General state associated with a surface
The fields buffer
, damage
and frame_callbacks
should be
reset (by clearing their contents) once you have adequately
processed them, as their contents are aggregated from commit to commit.
Fields
buffer: Option<BufferAssignment>
Buffer defining the contents of the surface
You are free to set this field to None
to avoid processing it several
times. It’ll be set to Some(...)
if the user attaches a buffer (or NULL
) to
the surface, and be left to None
if the user does not attach anything.
buffer_scale: i32
Scale of the contents of the buffer, for higher-resolution contents.
If it matches the one of the output displaying this surface, no change is necessary.
buffer_transform: Transform
Transform under which interpret the contents of the buffer
If it matches the one of the output displaying this surface, no change is necessary.
opaque_region: Option<RegionAttributes>
Region of the surface that is guaranteed to be opaque
By default the whole surface is potentially transparent
input_region: Option<RegionAttributes>
Region of the surface that is sensitive to user input
By default the whole surface should be sensitive
damage: Vec<Damage>
Damage rectangle
Hint provided by the client to suggest that only this part of the surface was changed and needs to be redrawn
frame_callbacks: Vec<WlCallback>
The frame callbacks associated with this surface for the commit
The server must send the notifications so that a client will not send excessive updates, while still allowing the highest possible update rate for clients that wait for the reply before drawing again. The server should give some time for the client to draw and commit after sending the frame callback events to let it hit the next output refresh.
A server should avoid signaling the frame callbacks if the surface is not visible in any way, e.g. the surface is off-screen, or completely obscured by other opaque surfaces.
An example possibility would be to trigger it once the frame associated with this commit has been displayed on the screen.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for SurfaceAttributes
impl Send for SurfaceAttributes
impl Sync for SurfaceAttributes
impl Unpin for SurfaceAttributes
impl !UnwindSafe for SurfaceAttributes
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert 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
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
pub fn vzip(self) -> V