wayland/buffer: Create EGLImage with no context

Since a wl_buffer is independent of the GL context in use (unlike, e.g.,
a GL renderbuffer), EGLImages with the EGL_WAYLAND_BUFFER_WL target must
pass EGL_NO_CONTEXT as the context. Quoting from the
EGL_WL_bind_wayland_display spec:

    After querying the wl_buffer layout, create EGLImages for the
    planes by calling eglCreateImageKHR with wl_buffer as
    EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target, NULL
    context.

The check was already present inside _cogl_egl_create_image.

https://bugzilla.gnome.org/show_bug.cgi?id=785263
Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2017-07-11 13:30:06 +01:00 committed by Florian Müllner
parent 4c3e166469
commit e82d039ec2

View File

@ -221,7 +221,6 @@ egl_image_buffer_attach (MetaWaylandBuffer *buffer,
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
EGLContext egl_context = cogl_egl_context_get_egl_context (cogl_context);
int format, width, height, y_inverted;
CoglPixelFormat cogl_format;
EGLImageKHR egl_image;
@ -265,7 +264,9 @@ egl_image_buffer_attach (MetaWaylandBuffer *buffer,
return FALSE;
}
egl_image = meta_egl_create_image (egl, egl_display, egl_context,
/* The WL_bind_wayland_display spec states that EGL_NO_CONTEXT is to be used
* in conjunction with the EGL_WAYLAND_BUFFER_WL target. */
egl_image = meta_egl_create_image (egl, egl_display, EGL_NO_CONTEXT,
EGL_WAYLAND_BUFFER_WL, buffer->resource,
NULL,
error);