compositor: move setup of scanout surface out of wlsc_output_repaint

Move this to a separate function to better accommodate changes in the
following commit.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
dev
Ander Conselvan de Oliveira 13 years ago committed by Kristian Høgsberg
parent 397b908d7b
commit 3b19966f19
  1. 27
      compositor/compositor.c

@ -839,6 +839,23 @@ out:
pixman_region32_fini(&cursor_region);
}
static int
setup_scanout_surface(struct wlsc_output *output, struct wlsc_surface *es)
{
if (es->visual != WLSC_RGB_VISUAL ||
output->prepare_scanout_surface(output, es) != 0)
return 0;
output->scanout_buffer = es->buffer;
output->scanout_buffer->busy_count++;
wl_list_remove(&output->scanout_buffer_destroy_listener.link);
wl_list_insert(output->scanout_buffer->resource.destroy_listener_list.prev,
&output->scanout_buffer_destroy_listener.link);
return 1;
}
static void
wlsc_output_repaint(struct wlsc_output *output)
{
@ -881,19 +898,11 @@ wlsc_output_repaint(struct wlsc_output *output)
es = container_of(ec->surface_list.next, struct wlsc_surface, link);
if (es->visual == WLSC_RGB_VISUAL &&
output->prepare_scanout_surface(output, es) == 0) {
if (setup_scanout_surface(output, es)) {
/* We're drawing nothing now,
* draw the damaged regions later. */
pixman_region32_union(&ec->damage, &ec->damage, &total_damage);
output->scanout_buffer = es->buffer;
output->scanout_buffer->busy_count++;
wl_list_remove(&output->scanout_buffer_destroy_listener.link);
wl_list_insert(output->scanout_buffer->resource.destroy_listener_list.prev,
&output->scanout_buffer_destroy_listener.link);
return;
}

Loading…
Cancel
Save