[gtk+] gl renderer: Clear resources after render_texture



commit 4fa4b8525e62c711e6a7c10f25d5015428b2fa27
Author: Timm Bäder <mail baedert org>
Date:   Sat Feb 3 13:24:55 2018 +0100

    gl renderer: Clear resources after render_texture
    
    This makes multiple consecutive render_texture calls on the same
    renderer work.

 gsk/gl/gskglrenderer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index c78f238..1bd311b 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -1939,8 +1939,6 @@ gsk_gl_renderer_unrealize (GskRenderer *renderer)
   for (i = 0; i < GL_N_PROGRAMS; i ++)
     glDeleteProgram (self->programs[i].id);
 
-  gsk_gl_renderer_destroy_buffers (self);
-
   gsk_gl_glyph_cache_free (&self->glyph_cache);
 
   g_clear_object (&self->gl_profiler);
@@ -2594,6 +2592,8 @@ gsk_gl_renderer_render_texture (GskRenderer           *renderer,
   /* Create texture from the downloaded data */
   texture = gdk_texture_new_for_data (g_steal_pointer (&data2), width, height, stride);
 
+  gsk_gl_renderer_destroy_buffers (self);
+  gsk_gl_renderer_clear_tree (self);
   return texture;
 }
 


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