diff options
author | Pekka Paalanen <pekka.paalanen@collabora.com> | 2022-07-20 14:44:31 +0300 |
---|---|---|
committer | Pekka Paalanen <pq@iki.fi> | 2022-07-29 08:54:21 +0000 |
commit | 7323ddec6273ce89c2031ee1ff9e55e1e3d7b41a (patch) | |
tree | 12fd04dbbd1ceb645f8e99fbddd703367ee63e40 /libweston | |
parent | d6b112c85741d7a9ac3de4b022573307ed130e73 (diff) | |
download | weston-7323ddec6273ce89c2031ee1ff9e55e1e3d7b41a.tar.gz |
pixman-renderer: let pixman allocate shadow
There is no need for us to allocate the storage manually, Pixman can do
that for us.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Diffstat (limited to 'libweston')
-rw-r--r-- | libweston/pixman-renderer.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/libweston/pixman-renderer.c b/libweston/pixman-renderer.c index c1ed560f..f9ccb230 100644 --- a/libweston/pixman-renderer.c +++ b/libweston/pixman-renderer.c @@ -41,7 +41,6 @@ #include <linux/input.h> struct pixman_output_state { - void *shadow_buffer; pixman_image_t *shadow_image; pixman_image_t *hw_buffer; pixman_region32_t *hw_extra_damage; @@ -951,19 +950,11 @@ pixman_renderer_output_create(struct weston_output *output, w = output->current_mode->width; h = output->current_mode->height; - po->shadow_buffer = malloc(w * h * 4); - - if (!po->shadow_buffer) { - free(po); - return -1; - } - po->shadow_image = - pixman_image_create_bits(PIXMAN_x8r8g8b8, w, h, - po->shadow_buffer, w * 4); + pixman_image_create_bits_no_clear(PIXMAN_x8r8g8b8, + w, h, NULL, 0); if (!po->shadow_image) { - free(po->shadow_buffer); free(po); return -1; } @@ -985,9 +976,6 @@ pixman_renderer_output_destroy(struct weston_output *output) if (po->hw_buffer) pixman_image_unref(po->hw_buffer); - free(po->shadow_buffer); - - po->shadow_buffer = NULL; po->shadow_image = NULL; po->hw_buffer = NULL; |