Return failure of wlr_renderer_init_wl_display()

This makes it easier for the user of this library to properly handle
failure of this function.

The signature of wlr_renderer_impl.init_wl_display was also modified to
allow for proper error propagation.
This commit is contained in:
Isaac Freund 2020-03-23 14:32:27 +01:00 committed by Simon Ser
parent 34303e1b47
commit c682d97841
4 changed files with 21 additions and 8 deletions

View file

@ -351,13 +351,15 @@ static struct wlr_texture *gles2_texture_from_dmabuf(
return wlr_gles2_texture_from_dmabuf(renderer->egl, attribs);
}
static void gles2_init_wl_display(struct wlr_renderer *wlr_renderer,
static bool gles2_init_wl_display(struct wlr_renderer *wlr_renderer,
struct wl_display *wl_display) {
struct wlr_gles2_renderer *renderer =
gles2_get_renderer(wlr_renderer);
if (!wlr_egl_bind_display(renderer->egl, wl_display)) {
wlr_log(WLR_INFO, "failed to bind wl_display to EGL");
return false;
}
return true;
}
struct wlr_egl *wlr_gles2_renderer_get_egl(struct wlr_renderer *wlr_renderer) {