[mutter] wayland/buffer: Create EGLImage with no context



commit 9a348aa8590bb9a1f2393c30908214ac2b79904e
Author: Daniel Stone <daniels collabora com>
Date:   Tue Jul 11 13:30:06 2017 +0100

    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>

 src/wayland/meta-wayland-buffer.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/wayland/meta-wayland-buffer.c b/src/wayland/meta-wayland-buffer.c
index 85c3c22..1b10c51 100644
--- a/src/wayland/meta-wayland-buffer.c
+++ b/src/wayland/meta-wayland-buffer.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]