From: Ray Strode Date: Sat, 28 Nov 2009 04:19:01 +0000 (-0500) Subject: [x11] implement new activate/deactivate methods X-Git-Tag: 0.8.0~104^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe6d25904d292bb326e31bb013452f447cda4301;p=thirdparty%2Fplymouth.git [x11] implement new activate/deactivate methods We disable flushing when inactive. --- diff --git a/src/plugins/renderers/x11/plugin.c b/src/plugins/renderers/x11/plugin.c index 9e78c069..3777b6c2 100644 --- a/src/plugins/renderers/x11/plugin.c +++ b/src/plugins/renderers/x11/plugin.c @@ -86,6 +86,8 @@ struct _ply_renderer_backend ply_console_t *console; ply_fd_watch_t *display_watch; + + uint32_t is_inactive : 1; }; ply_renderer_plugin_interface_t *ply_renderer_backend_get_interface (void); @@ -307,6 +309,18 @@ unmap_from_device (ply_renderer_backend_t *backend) ply_console_ignore_mode_changes (backend->console, false); } +static void +activate (ply_renderer_backend_t *backend) +{ + backend->is_inactive = false; +} + +static void +deactivate (ply_renderer_backend_t *backend) +{ + backend->is_inactive = true; +} + static void flush_area_to_device (ply_renderer_backend_t *backend, ply_renderer_head_t *head, @@ -338,6 +352,9 @@ flush_head (ply_renderer_backend_t *backend, assert (backend != NULL); + if (backend->is_inactive) + return; + pixel_buffer = head->pixel_buffer; updated_region = ply_pixel_buffer_get_updated_areas (pixel_buffer); areas_to_flush = ply_region_get_rectangle_list (updated_region); @@ -516,6 +533,8 @@ ply_renderer_backend_get_interface (void) .query_device = query_device, .map_to_device = map_to_device, .unmap_from_device = unmap_from_device, + .activate = activate, + .deactivate = deactivate, .flush_head = flush_head, .get_heads = get_heads, .get_buffer_for_head = get_buffer_for_head,