From d7ec784e5d69af9d9addf5ef95df5c40af3df478 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Sat, 31 Dec 2022 21:05:09 -0500 Subject: Only submit opaque (XRGB8888) buffers This lets the compositor avoid needing to clear and blend the pixels behind the background surface made by swaybg. --- main.c | 2 +- pool-buffer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 0f5e7ad..181adb4 100644 --- a/main.c +++ b/main.c @@ -120,7 +120,7 @@ static struct wl_buffer *draw_buffer(const struct swaybg_output *output, struct pool_buffer buffer; if (!create_buffer(&buffer, output->state->shm, - buffer_width, buffer_height, WL_SHM_FORMAT_ARGB8888)) { + buffer_width, buffer_height, WL_SHM_FORMAT_XRGB8888)) { return NULL; } diff --git a/pool-buffer.c b/pool-buffer.c index 9872ec5..4b7b63b 100644 --- a/pool-buffer.c +++ b/pool-buffer.c @@ -59,7 +59,7 @@ bool create_buffer(struct pool_buffer *buf, struct wl_shm *shm, buf->size = size; buf->data = data; buf->surface = cairo_image_surface_create_for_data(data, - CAIRO_FORMAT_ARGB32, width, height, stride); + CAIRO_FORMAT_RGB24, width, height, stride); buf->cairo = cairo_create(buf->surface); return true; } -- cgit v1.2.3