compositor-x11: Move vfunc setting from set_size to enable

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Armin Krezović 8 years ago committed by Daniel Stone
parent 2e66252582
commit 225bf9dff1
  1. 20
      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*
@ -932,8 +933,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);
@ -999,17 +1008,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;
}

Loading…
Cancel
Save