mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 21:48:04 +02:00
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>
This commit is contained in:
parent
d6b112c857
commit
7323ddec62
1 changed files with 2 additions and 14 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue