From 47a8dc80400ddd4527f06c9d0c90100d993e1c19 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 20 Jun 2020 21:43:35 +0000 Subject: [PATCH] buffer: Leave pixman out of buffers --- include/buffer.h | 3 +-- src/buffer.c | 12 ------------ 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/include/buffer.h b/include/buffer.h index 57c9dfa..359ace7 100644 --- a/include/buffer.h +++ b/include/buffer.h @@ -3,8 +3,8 @@ #include "sys/queue.h" #include -#include #include +#include struct wl_buffer; @@ -13,7 +13,6 @@ struct wv_buffer { struct wl_buffer* wl_buffer; void* pixels; size_t size; - pixman_image_t* image; int width, height, stride; uint32_t format; bool y_inverted; diff --git a/src/buffer.c b/src/buffer.c index 25b1514..74ca6ff 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include "shm.h" @@ -20,9 +19,6 @@ struct wv_buffer* wv_buffer_create(int width, int height, int stride, { assert(wl_shm); enum wl_shm_format wl_fmt = fourcc_to_wl_shm(fourcc); - pixman_format_code_t pixman_fmt = 0; - if (!fourcc_to_pixman_fmt(&pixman_fmt, fourcc)) - return NULL; struct wv_buffer* self = calloc(1, sizeof(*self)); if (!self) @@ -43,11 +39,6 @@ struct wv_buffer* wv_buffer_create(int width, int height, int stride, if (!self->pixels) goto mmap_failure; - self->image = pixman_image_create_bits(pixman_fmt, width, height, - self->pixels, stride); - if (!self->image) - goto pixman_failure; - struct wl_shm_pool* pool = wl_shm_create_pool(wl_shm, fd, self->size); if (!pool) goto pool_failure; @@ -63,8 +54,6 @@ struct wv_buffer* wv_buffer_create(int width, int height, int stride, shm_failure: pool_failure: - pixman_image_unref(self->image); -pixman_failure: munmap(self->pixels, self->size); mmap_failure: close(fd); @@ -76,7 +65,6 @@ failure: void wv_buffer_destroy(struct wv_buffer* self) { wl_buffer_destroy(self->wl_buffer); - pixman_image_unref(self->image); munmap(self->pixels, self->size); free(self); }