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.
This commit is contained in:
Daniel Eklöf 2020-06-04 15:39:19 +02:00
parent 0d0df56796
commit 8b320ed296
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 62 additions and 60 deletions

5
shm.h
View file

@ -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);