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>
This commit is contained in:
committed by
Kristian Høgsberg
parent
397b908d7b
commit
3b19966f19
+18
-9
@@ -839,6 +839,23 @@ out:
|
|||||||
pixman_region32_fini(&cursor_region);
|
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
|
static void
|
||||||
wlsc_output_repaint(struct wlsc_output *output)
|
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);
|
es = container_of(ec->surface_list.next, struct wlsc_surface, link);
|
||||||
|
|
||||||
if (es->visual == WLSC_RGB_VISUAL &&
|
if (setup_scanout_surface(output, es)) {
|
||||||
output->prepare_scanout_surface(output, es) == 0) {
|
|
||||||
/* We're drawing nothing now,
|
/* We're drawing nothing now,
|
||||||
* draw the damaged regions later. */
|
* draw the damaged regions later. */
|
||||||
pixman_region32_union(&ec->damage, &ec->damage, &total_damage);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user