[PATCH weston 1/2] compositor-x11: Move vfunc setting from set_size to enable

Armin Krezović krezovic.armin at gmail.com
Fri Oct 28 22:26:45 UTC 2016


Signed-off-by: Armin Krezović <krezovic.armin at gmail.com>
---
 libweston/compositor-x11.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/libweston/compositor-x11.c b/libweston/compositor-x11.c
index 1c6de08..7709d8f 100644
--- a/libweston/compositor-x11.c
+++ b/libweston/compositor-x11.c
@@ -917,6 +917,7 @@ x11_output_enable(struct weston_output *base)
 			weston_log("Failed to create pixman renderer for output\n");
 			x11_output_deinit_shm(b, output);
 			goto err;
+		output->base.repaint = x11_output_repaint_shm;
 		}
 	} else {
 		/* eglCreatePlatformWindowSurfaceEXT takes a Window*
@@ -931,8 +932,16 @@ x11_output_enable(struct weston_output *base)
 						 0);
 		if (ret < 0)
 			goto err;
+
+		output->base.repaint = x11_output_repaint_gl;
 	}
 
+	output->base.start_repaint_loop = x11_output_start_repaint_loop;
+	output->base.assign_planes = NULL;
+	output->base.set_backlight = NULL;
+	output->base.set_dpms = NULL;
+	output->base.switch_mode = NULL;
+
 	loop = wl_display_get_event_loop(b->compositor->wl_display);
 	output->finish_frame_timer =
 		wl_event_loop_add_timer(loop, finish_frame_handler, output);
@@ -998,17 +1007,6 @@ x11_output_set_size(struct weston_output *base, int width, int height)
 	output->base.mm_height = height * b->screen->height_in_millimeters /
 		b->screen->height_in_pixels;
 
-	if (b->use_pixman)
-		output->base.repaint = x11_output_repaint_shm;
-	else
-		output->base.repaint = x11_output_repaint_gl;
-
-	output->base.start_repaint_loop = x11_output_start_repaint_loop;
-	output->base.assign_planes = NULL;
-	output->base.set_backlight = NULL;
-	output->base.set_dpms = NULL;
-	output->base.switch_mode = NULL;
-
 	return 0;
 }
 
-- 
2.10.1



More information about the wayland-devel mailing list