From 8b320ed29630e75c058bbf368ea5e2e9a68d0143 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 4 Jun 2020 15:39:19 +0200 Subject: render: re-write cell clipping to use pixman destination clipping Our home rolled clip-to-cell code was, obviously, not correct. The original problem was that we couldn't use pixman clipping since we have multiple threads writing to the same pixman image, and thus there would be races between the threads setting clipping. The fix is actually simple - just instantiate one pixman image (referencing the same backing image data) for each rendering thread. --- shm.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'shm.h') diff --git a/shm.h b/shm.h index aff53d76..4c8e9506 100644 --- a/shm.h +++ b/shm.h @@ -19,7 +19,8 @@ struct buffer { void *mmapped; /* Raw data (TODO: rename) */ struct wl_buffer *wl_buf; - pixman_image_t *pix; + pixman_image_t **pix; + size_t pix_instances; /* Internal */ int fd; /* memfd */ @@ -34,7 +35,7 @@ struct buffer { }; struct buffer *shm_get_buffer( - struct wl_shm *shm, int width, int height, unsigned long cookie, bool scrollable); + struct wl_shm *shm, int width, int height, unsigned long cookie, bool scrollable, size_t pix_instances); void shm_fini(void); void shm_set_max_pool_size(off_t max_pool_size); -- cgit v1.3