[mutter] wayland/dma-buf: Don't use API meant for MetaWaylandSurface internally



commit 22a296f9711243a3dc37c7daf7c6b6b974cdb156
Author: Jonas Ådahl <jadahl gmail com>
Date:   Fri Feb 8 11:44:00 2019 +0100

    wayland/dma-buf: Don't use API meant for MetaWaylandSurface internally
    
    What was actually done when calling meta_wayland_buffer_attach() was
    that the texture was realized, so just call the function
    `meta_wayland_dma_buf_realize_texture()` and call that.
    
    This is in preparation to change how meta_wayland_buffer_attach() work.
    
    https://gitlab.gnome.org/GNOME/mutter/issues/199

 src/wayland/meta-wayland-dma-buf.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/wayland/meta-wayland-dma-buf.c b/src/wayland/meta-wayland-dma-buf.c
index 347da2484..fd610cc17 100644
--- a/src/wayland/meta-wayland-dma-buf.c
+++ b/src/wayland/meta-wayland-dma-buf.c
@@ -65,9 +65,9 @@ struct _MetaWaylandDmaBufBuffer
 
 G_DEFINE_TYPE (MetaWaylandDmaBufBuffer, meta_wayland_dma_buf_buffer, G_TYPE_OBJECT);
 
-gboolean
-meta_wayland_dma_buf_buffer_attach (MetaWaylandBuffer *buffer,
-                                    GError           **error)
+static gboolean
+meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer  *buffer,
+                                      GError            **error)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaEgl *egl = meta_backend_get_egl (backend);
@@ -202,6 +202,14 @@ meta_wayland_dma_buf_buffer_attach (MetaWaylandBuffer *buffer,
   return TRUE;
 }
 
+gboolean
+meta_wayland_dma_buf_buffer_attach (MetaWaylandBuffer  *buffer,
+                                    CoglTexture       **texture,
+                                    GError            **error)
+{
+  return meta_wayland_dma_buf_realize_texture (buffer, error);
+}
+
 static void
 buffer_params_add (struct wl_client   *client,
                    struct wl_resource *resource,
@@ -374,7 +382,7 @@ buffer_params_create_common (struct wl_client   *client,
   buffer = meta_wayland_buffer_from_resource (buffer_resource);
 
   meta_wayland_buffer_realize (buffer);
-  if (!meta_wayland_buffer_attach (buffer, &error))
+  if (!meta_wayland_dma_buf_realize_texture (buffer, &error))
     {
       if (buffer_id == 0)
         {


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