[weston] gl-renderer: conditionally call query_buffer while gl_renderer_attach
Giulio Camuffo
giuliocamuffo at gmail.com
Tue Nov 1 17:58:11 UTC 2016
Hi,
2016-10-07 17:08 GMT+02:00 Vincent Abriou <vincent.abriou at st.com>:
> While gl_renderer_attach, query_buffer should be call only if the
> query_buffer function exists.
>
> 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 6276188..caa72d7 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->query_buffer &&
gr->query_buffer is eglQueryWaylandBufferWL, which is mandated by the
EGL_WL_bind_wayland_display extension. So rather than checking
query_buffer here, i think it should check for gr->has_bind_display,
which makes it more explicit that it's not just that function missing,
but the whole thing.
Thanks,
Giulio
> + 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
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list