compositor: Move repaint loop into a backend function
We've trimmed down the actual repaint loop to just iterating through the
surface list and calling weston_surface_draw(), so we push that to the
backend without too much code duplication.
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 1f30e7b..b987a12 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -94,6 +94,19 @@
return 0;
}
+static void
+drm_output_repaint(struct weston_output *output)
+{
+ struct weston_compositor *compositor = output->compositor;
+ struct weston_surface *surface;
+
+ surface = container_of(compositor->surface_list.next,
+ struct weston_surface, link);
+
+ wl_list_for_each_reverse(surface, &compositor->surface_list, link)
+ weston_surface_draw(surface, output);
+}
+
static int
drm_output_present(struct weston_output *output_base)
{
@@ -554,6 +567,7 @@
output->pending_fs_surf_fb_id = 0;
output->base.prepare_render = drm_output_prepare_render;
+ output->base.repaint = drm_output_repaint;
output->base.present = drm_output_present;
output->base.prepare_scanout_surface =
drm_output_prepare_scanout_surface;