compositor: Consolidate output repaint logic

We move the EGL and GLES2 output repaint code into a new gles2-render.c
file.  The eglMakeCurrent, glViewPort, surface loop etc was duplicated
across all backends, but this patch moves it to a new file.
diff --git a/src/compositor.h b/src/compositor.h
index 38c2657..23eaeb3 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -149,6 +149,7 @@
 struct weston_output {
 	uint32_t id;
 
+	EGLSurface egl_surface;
 	struct wl_list link;
 	struct wl_list resource_list;
 	struct wl_global *global;
@@ -177,7 +178,7 @@
 	struct wl_list mode_list;
 
 	void (*repaint)(struct weston_output *output,
-			pixman_region32_t *damage, int flip);
+			pixman_region32_t *damage);
 	void (*destroy)(struct weston_output *output);
 	void (*assign_planes)(struct weston_output *output);
 	int (*switch_mode)(struct weston_output *output, struct weston_mode *mode);
@@ -794,4 +795,8 @@
 int
 weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode);
 
+void
+gles2_renderer_repaint_output(struct weston_output *output,
+			      pixman_region32_t *output_damage);
+
 #endif