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

Produce a new state to be cached from the pending state

Merge a state update into the current state

Formats the value using the given formatter. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

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

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.