shared/client-buffer-util: Add buffer type enum

This will be helpful in follow-up commits.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
This commit is contained in:
Robert Mader 2025-09-25 17:34:32 +02:00
parent 618bfad1d4
commit e27929e3b3
2 changed files with 8 additions and 0 deletions

View file

@ -231,6 +231,7 @@ client_buffer_util_create_shm_buffer(struct wl_shm *shm,
buf = xzalloc(sizeof *buf);
buf->fmt = fmt;
buf->type = CLIENT_BUFFER_TYPE_SHM;
buf->width = width;
buf->height = height;
@ -321,6 +322,7 @@ client_buffer_util_create_dmabuf_buffer(struct wl_display *display,
buf = xzalloc(sizeof *buf);
buf->fmt = fmt;
buf->type = CLIENT_BUFFER_TYPE_DMABUF;
buf->width = width;
buf->height = height;

View file

@ -37,8 +37,14 @@ struct zwp_linux_dmabuf_v1;
#define MAX_DMABUF_PLANES 4
enum client_buffer_type {
CLIENT_BUFFER_TYPE_SHM = 1,
CLIENT_BUFFER_TYPE_DMABUF,
};
struct client_buffer {
const struct pixel_format_info *fmt;
enum client_buffer_type type;
struct wl_buffer *wl_buffer;
void *data;
size_t bytes;