[weston v2] gl-renderer: conditionally call query_buffer while gl_renderer_attach

Vincent Abriou vincent.abriou at st.com
Thu Nov 3 10:15:32 UTC 2016


While gl_renderer_attach, query_buffer should be call only if the
query_buffer function exists ie when has_bind_display is true.

v2:
 - Take into account Giulio's remark. Use has_bind_display viariable to test if
   EGL_WL_bind_wayland_display extension is supported.

Change-Id: I5b5995fec67351cc8e4746f932d7ace838fa73be
Signed-off-by: Vincent Abriou <vincent.abriou at st.com>
---
 libweston/gl-renderer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
index 9747de5..3e8e5ab 100644
--- a/libweston/gl-renderer.c
+++ b/libweston/gl-renderer.c
@@ -2004,7 +2004,8 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer)
 
 	if (shm_buffer)
 		gl_renderer_attach_shm(es, buffer, shm_buffer);
-	else if (gr->query_buffer(gr->egl_display, (void *) buffer->resource,
+	else if (gr->has_bind_display &&
+		 gr->query_buffer(gr->egl_display, (void *)buffer->resource,
 				  EGL_TEXTURE_FORMAT, &format))
 		gl_renderer_attach_egl(es, buffer, format);
 	else if ((dmabuf = linux_dmabuf_buffer_get(buffer->resource)))
-- 
1.9.1



More information about the wayland-devel mailing list