wayland: Add single pixel buffer support

The "single pixel buffer" Wayland protocol extension provides a way for
clients to create 1x1 buffers with a single color, specified by
providing the color channels (red, green and blue) as well as the
alpha channel as a 32 bit unsigned integer.

For now, this is turned into a 1x1 texture. Future potential
improvements is to hook things up to the scanout candidate logic and
turn it into a scanout capable DMA buffer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2246>
This commit is contained in:
Jonas Ådahl
2022-01-19 11:49:32 +01:00
committed by Marge Bot
parent 823e3a5c72
commit 2cb7499735
8 changed files with 255 additions and 2 deletions

View File

@@ -780,8 +780,10 @@ meta_wayland_surface_apply_state (MetaWaylandSurface *surface,
* it until is replaced by a subsequent wl_surface.commit or when the
* wl_surface is destroyed.
*/
surface->buffer_held = (state->buffer &&
!wl_shm_buffer_get (state->buffer->resource));
surface->buffer_held =
(state->buffer &&
(state->buffer->type != META_WAYLAND_BUFFER_TYPE_SHM &&
state->buffer->type != META_WAYLAND_BUFFER_TYPE_SINGLE_PIXEL));
}
if (state->scale > 0)