From e986de729d34511c108aef6d957800d34d8df1d1 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 12 Sep 2019 17:17:55 +0300 Subject: [PATCH] backend-headless: refactor into headless_output_disable_pixman Pure refactoring. Preparing for adding GL-renderer. Signed-off-by: Pekka Paalanen --- libweston/backend-headless/headless.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/libweston/backend-headless/headless.c b/libweston/backend-headless/headless.c index 4faf1703..0b190250 100644 --- a/libweston/backend-headless/headless.c +++ b/libweston/backend-headless/headless.c @@ -121,6 +121,14 @@ headless_output_repaint(struct weston_output *output_base, return 0; } +static void +headless_output_disable_pixman(struct headless_output *output) +{ + pixman_renderer_output_destroy(&output->base); + pixman_image_unref(output->image); + free(output->image_buf); +} + static int headless_output_disable(struct weston_output *base) { @@ -132,11 +140,8 @@ headless_output_disable(struct weston_output *base) wl_event_source_remove(output->finish_frame_timer); - if (b->use_pixman) { - pixman_renderer_output_destroy(&output->base); - pixman_image_unref(output->image); - free(output->image_buf); - } + if (b->use_pixman) + headless_output_disable_pixman(output); return 0; }