weston_buffer: Add solid buffer type
Currently solid-colour displays (e.g. the background for fullscreen views) is implemented by a special-case weston_surface which has no buffer attached, with a special punch-through renderer callback to set the colour. Replace this with a weston_buffer type explicitly specifying the solid colour, which helps us eliminate yet more special cases in renderers and backends. This is not handled yet in any renderer or backend, however it is also not used by anything yet. Following commits add support to the renderers and backends. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
@@ -1181,12 +1181,16 @@ struct weston_buffer {
|
||||
WESTON_BUFFER_SHM,
|
||||
WESTON_BUFFER_DMABUF,
|
||||
WESTON_BUFFER_RENDERER_OPAQUE,
|
||||
WESTON_BUFFER_SOLID,
|
||||
} type;
|
||||
|
||||
union {
|
||||
struct wl_shm_buffer *shm_buffer;
|
||||
void *dmabuf;
|
||||
void *legacy_buffer;
|
||||
struct {
|
||||
float r, g, b, a;
|
||||
} solid;
|
||||
};
|
||||
|
||||
int32_t width, height;
|
||||
@@ -1768,6 +1772,13 @@ weston_surface_create(struct weston_compositor *compositor);
|
||||
struct weston_view *
|
||||
weston_view_create(struct weston_surface *surface);
|
||||
|
||||
struct weston_buffer_reference *
|
||||
weston_buffer_create_solid_rgba(struct weston_compositor *compositor,
|
||||
float r, float g, float b, float a);
|
||||
|
||||
void
|
||||
weston_buffer_destroy_solid(struct weston_buffer_reference *buffer_ref);
|
||||
|
||||
void
|
||||
weston_view_destroy(struct weston_view *view);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user