From ff35efeb41ffae4d3e897915fbfa8702be5b2698 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 8 May 2021 13:12:26 -0400 Subject: [PATCH] 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); + eglDestroyImage (display_wayland->egl_display, image); - idata->display = display_wayland->egl_display; - idata->image = 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