[Cogl] [PATCH] wayland-server: Use wl_resource instead of wl_buffer

Neil Roberts neil at linux.intel.com
Thu Oct 24 07:58:40 PDT 2013


wl_buffer has been deprecated in the server API and instead
compositors should be directly passing the wl_resource pointer to
eglQueryWaylandBuffer.
---
 cogl/cogl-texture-2d.c                          | 5 ++---
 cogl/winsys/cogl-winsys-egl-feature-functions.h | 2 +-
 cogl/winsys/cogl-winsys-egl-private.h           | 2 +-
 cogl/winsys/cogl-winsys-egl.c                   | 2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c
index fbf836e..07a9a3c 100644
--- a/cogl/cogl-texture-2d.c
+++ b/cogl/cogl-texture-2d.c
@@ -294,12 +294,12 @@ _cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
 #ifdef COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT
 CoglTexture2D *
 cogl_wayland_texture_2d_new_from_buffer (CoglContext *ctx,
-                                         struct wl_resource *buffer_resource,
+                                         struct wl_resource *buffer,
                                          CoglError **error)
 {
   struct wl_shm_buffer *shm_buffer;
 
-  shm_buffer = wl_shm_buffer_get (buffer_resource);
+  shm_buffer = wl_shm_buffer_get (buffer);
 
   if (shm_buffer)
     {
@@ -343,7 +343,6 @@ cogl_wayland_texture_2d_new_from_buffer (CoglContext *ctx,
     }
   else
     {
-      struct wl_buffer *buffer = (struct wl_buffer *) buffer_resource;
       int format, width, height;
 
       if (_cogl_egl_query_wayland_buffer (ctx,
diff --git a/cogl/winsys/cogl-winsys-egl-feature-functions.h b/cogl/winsys/cogl-winsys-egl-feature-functions.h
index 2758843..85c3079 100644
--- a/cogl/winsys/cogl-winsys-egl-feature-functions.h
+++ b/cogl/winsys/cogl-winsys-egl-feature-functions.h
@@ -88,7 +88,7 @@ COGL_WINSYS_FEATURE_FUNCTION (EGLBoolean, eglUnbindWaylandDisplay,
                                struct wl_display *wayland_display))
 COGL_WINSYS_FEATURE_FUNCTION (EGLBoolean, eglQueryWaylandBuffer,
                               (EGLDisplay dpy,
-                               struct wl_buffer *buffer,
+                               struct wl_resource *buffer,
                                EGLint attribute, EGLint *value))
 COGL_WINSYS_FEATURE_END ()
 
diff --git a/cogl/winsys/cogl-winsys-egl-private.h b/cogl/winsys/cogl-winsys-egl-private.h
index 9a3b4ad..8f33191 100644
--- a/cogl/winsys/cogl-winsys-egl-private.h
+++ b/cogl/winsys/cogl-winsys-egl-private.h
@@ -162,7 +162,7 @@ _cogl_egl_destroy_image (CoglContext *ctx,
 #ifdef EGL_WL_bind_wayland_display
 CoglBool
 _cogl_egl_query_wayland_buffer (CoglContext *ctx,
-                                struct wl_buffer *buffer,
+                                struct wl_resource *buffer,
                                 int attribute,
                                 int *value);
 #endif
diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
index 18d2649..7df2245 100644
--- a/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/winsys/cogl-winsys-egl.c
@@ -1045,7 +1045,7 @@ _cogl_egl_destroy_image (CoglContext *ctx,
 #ifdef EGL_WL_bind_wayland_display
 CoglBool
 _cogl_egl_query_wayland_buffer (CoglContext *ctx,
-                                struct wl_buffer *buffer,
+                                struct wl_resource *buffer,
                                 int attribute,
                                 int *value)
 {
-- 
1.8.3.1



More information about the Cogl mailing list