From 1940972ca9f0ab70733804506e1ae400351a4dcb Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Mon, 30 Nov 2015 18:19:30 +0000 Subject: worker: move red_process_draw to display-channel.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Frediano Ziglio Acked-by: Fabiano FidĂȘncio Acked-by: Jonathon Jongsma --- server/display-channel.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'server/display-channel.c') diff --git a/server/display-channel.c b/server/display-channel.c index 7aa54ede..fd3a592e 100644 --- a/server/display-channel.c +++ b/server/display-channel.c @@ -1098,9 +1098,9 @@ static int validate_drawable_bbox(DisplayChannel *display, RedDrawable *drawable * * @return initialized Drawable or NULL on failure */ -Drawable *display_channel_get_drawable(DisplayChannel *display, uint8_t effect, - RedDrawable *red_drawable, uint32_t group_id, - uint32_t process_commands_generation) +static Drawable *display_channel_get_drawable(DisplayChannel *display, uint8_t effect, + RedDrawable *red_drawable, uint32_t group_id, + uint32_t process_commands_generation) { Drawable *drawable; int x; @@ -1145,7 +1145,7 @@ Drawable *display_channel_get_drawable(DisplayChannel *display, uint8_t effect, * Add a Drawable to the items to draw. * On failure the Drawable is not added. */ -void display_channel_add_drawable(DisplayChannel *display, Drawable *drawable) +static void display_channel_add_drawable(DisplayChannel *display, Drawable *drawable) { int success = FALSE, surface_id = drawable->surface_id; RedDrawable *red_drawable = drawable->red_drawable; @@ -1195,6 +1195,23 @@ void display_channel_add_drawable(DisplayChannel *display, Drawable *drawable) #endif } +void display_channel_process_draw(DisplayChannel *display, RedDrawable *red_drawable, + uint32_t group_id, int process_commands_generation) +{ + Drawable *drawable = + display_channel_get_drawable(display, red_drawable->effect, red_drawable, group_id, + process_commands_generation); + + if (!drawable) { + return; + } + + display_channel_add_drawable(display, drawable); + + display_channel_drawable_unref(display, drawable); +} + + int display_channel_wait_for_migrate_data(DisplayChannel *display) { uint64_t end_time = red_get_monotonic_time() + DISPLAY_CLIENT_MIGRATE_DATA_TIMEOUT; -- cgit v1.2.3