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-wayland.c b/src/compositor-wayland.c
index 4fa9df1..c909253 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -177,6 +177,16 @@
 }
 
 static void
+wayland_output_repaint(struct weston_output *output)
+{
+	struct weston_compositor *compositor = output->compositor;
+	struct weston_surface *surface;
+
+	wl_list_for_each_reverse(surface, &compositor->surface_list, link)
+		weston_surface_draw(surface, output);
+}
+
+static void
 frame_done(void *data, struct wl_callback *wl_callback, uint32_t time)
 {
 	struct weston_output *output = data;
@@ -291,6 +301,7 @@
 	glClearColor(0, 0, 0, 0.5);
 
 	output->base.prepare_render = wayland_output_prepare_render;
+	output->base.repaint = wayland_output_repaint;
 	output->base.present = wayland_output_present;
 	output->base.prepare_scanout_surface =
 		wayland_output_prepare_scanout_surface;