gl-renderer: conditionally call query_buffer while gl_renderer_attach

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.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Vincent Abriou 2016-11-03 11:15:32 +01:00 committed by Daniel Stone
parent 7327d5a7a2
commit 9c526e0e62

View File

@ -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)))