Skip to content

Commit

Permalink
Only submit opaque (XRGB8888) buffers
Browse files Browse the repository at this point in the history
This lets the compositor avoid needing to clear and blend the
pixels behind the background surface made by swaybg.
  • Loading branch information
mstoeckl committed Jan 1, 2023
1 parent 34be8b0 commit d4e6963
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static void render_frame(struct swaybg_output *output, cairo_surface_t *surface)

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;
}

Expand Down
2 changes: 1 addition & 1 deletion pool-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,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;
}
Expand Down

0 comments on commit d4e6963

Please sign in to comment.