[gtk/import-dmabuf: 1/2] wayland: Destroy the EglImage right away




commit ff35efeb41ffae4d3e897915fbfa8702be5b2698
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 8 13:12:26 2021 -0400

    wayland: Destroy the EglImage right away
    
    I'm told there is no need to keep it around.

 gdk/wayland/gdkglcontext-wayland.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)
---
diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c
index 981d5c43b0..fa410c41e8 100644
--- a/gdk/wayland/gdkglcontext-wayland.c
+++ b/gdk/wayland/gdkglcontext-wayland.c
@@ -313,19 +313,6 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
   gdk_wayland_surface_notify_committed (surface);
 }
 
-typedef struct {
-  EGLDisplay display;
-  EGLImage image;
-} ImageData;
-
-static void
-free_image (gpointer data)
-{
-  ImageData *idata = data;
-  eglDestroyImage (idata->display, idata->image);
-  g_free (data);
-}
-
 static GdkTexture *
 gdk_wayland_gl_context_import_dmabuf (GdkGLContext *context,
                                       int           fd,
@@ -348,7 +335,6 @@ gdk_wayland_gl_context_import_dmabuf (GdkGLContext *context,
     EGL_NONE
   };
   EGLImage image;
-  ImageData *idata;
 
   gdk_gl_context_make_current (context);
 
@@ -393,12 +379,9 @@ gdk_wayland_gl_context_import_dmabuf (GdkGLContext *context,
   glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
   glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 
-  idata = g_new (ImageData, 1);
-
-  idata->display = display_wayland->egl_display;
-  idata->image = image;
+  eglDestroyImage (display_wayland->egl_display, image);
 
-  return gdk_gl_texture_new (context, texture, width, height, free_image, idata);
+  return gdk_gl_texture_new (context, texture, width, height, NULL, NULL);
 }
 
 static void


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