From 035a0323ef0571b37d5949b10b79f7620f012617 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Wed, 24 Oct 2012 09:43:06 +0300 Subject: [PATCH] gles2: check eglBindWaylandDisplayWL return value If the bind fails, do not bother pretending the EGL Wayland extension is usable, and no need to unbind, either. Print some important details about the GLESv2 renderer configuration into the log. Signed-off-by: Pekka Paalanen --- src/gles2-renderer.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gles2-renderer.c b/src/gles2-renderer.c index 15b0f4d..544cc15 100644 --- a/src/gles2-renderer.c +++ b/src/gles2-renderer.c @@ -1258,8 +1258,11 @@ gles2_renderer_init(struct weston_compositor *ec) if (strstr(extensions, "EGL_WL_bind_wayland_display")) ec->has_bind_display = 1; - if (ec->has_bind_display) - ec->bind_display(ec->egl_display, ec->wl_display); + if (ec->has_bind_display) { + ret = ec->bind_display(ec->egl_display, ec->wl_display); + if (!ret) + ec->has_bind_display = 0; + } glActiveTexture(GL_TEXTURE0); @@ -1292,5 +1295,13 @@ gles2_renderer_init(struct weston_compositor *ec) renderer->base.destroy_surface = gles2_renderer_destroy_surface; ec->renderer = &renderer->base; + weston_log("GL ES 2 renderer features:\n"); + weston_log_continue(STAMP_SPACE "read-back format: %s\n", + ec->read_format == GL_BGRA_EXT ? "BGRA" : "RGBA"); + weston_log_continue(STAMP_SPACE "wl_shm sub-image to texture: %s\n", + ec->has_unpack_subimage ? "yes" : "no"); + weston_log_continue(STAMP_SPACE "EGL Wayland extension: %s\n", + ec->has_bind_display ? "yes" : "no"); + return 0; } -- 2.7.4