[PATCH weston 05/10] compositor-wayland: Move vfunc setting from set_size to enable

Armin Krezović krezovic.armin at gmail.com
Sun Oct 9 15:30:26 UTC 2016


Signed-off-by: Armin Krezović <krezovic.armin at gmail.com>
---
 libweston/compositor-wayland.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c
index d26360e..42cebe7 100644
--- a/libweston/compositor-wayland.c
+++ b/libweston/compositor-wayland.c
@@ -1088,11 +1088,21 @@ wayland_output_enable(struct weston_output *base)
 	if (b->use_pixman) {
 		if (wayland_output_init_pixman_renderer(output) < 0)
 			goto err_output;
+
+		output->base.repaint = wayland_output_repaint_pixman;
 	} else {
 		if (wayland_output_init_gl_renderer(output) < 0)
 			goto err_output;
+
+		output->base.repaint = wayland_output_repaint_gl;
 	}
 
+	output->base.start_repaint_loop = wayland_output_start_repaint_loop;
+	output->base.assign_planes = NULL;
+	output->base.set_backlight = NULL;
+	output->base.set_dpms = NULL;
+	output->base.switch_mode = wayland_output_switch_mode;
+
 	if (b->sprawl_across_outputs) {
 		wayland_output_set_fullscreen(output,
 					      WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER,
@@ -1166,7 +1176,6 @@ static int
 wayland_output_set_size(struct weston_output *base, int width, int height)
 {
 	struct wayland_output *output = to_wayland_output(base);
-	struct wayland_backend *b = to_wayland_backend(base->compositor);
 	int output_width, output_height;
 
 	/* We can only be called once. */
@@ -1208,17 +1217,6 @@ wayland_output_set_size(struct weston_output *base, int width, int height)
 	output->base.mm_width = width;
 	output->base.mm_height = height;
 
-	if (b->use_pixman)
-		output->base.repaint = wayland_output_repaint_pixman;
-	else
-		output->base.repaint = wayland_output_repaint_gl;
-
-	output->base.start_repaint_loop = wayland_output_start_repaint_loop;
-	output->base.assign_planes = NULL;
-	output->base.set_backlight = NULL;
-	output->base.set_dpms = NULL;
-	output->base.switch_mode = wayland_output_switch_mode;
-
 	return 0;
 }
 
-- 
2.10.1



More information about the wayland-devel mailing list