mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 05:50:10 +00:00
cairo-gl: Don't leak framebuffers
The framebufffer was cached, but never deleted. And because this function is deprecated and nobody should ever use it: Don't bother with caching now.
This commit is contained in:
parent
482845b027
commit
111c2769a5
@ -355,10 +355,8 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
es_use_bgra = gdk_gl_context_use_es_bgra (paint_context);
|
||||
|
||||
gdk_gl_context_make_current (paint_context);
|
||||
paint_data = gdk_gl_context_get_paint_data (paint_context);
|
||||
|
||||
if (paint_data->tmp_framebuffer == 0)
|
||||
glGenFramebuffers (1, &paint_data->tmp_framebuffer);
|
||||
glGenFramebuffers (1, &framebuffer);
|
||||
|
||||
if (source_type == GL_RENDERBUFFER)
|
||||
{
|
||||
@ -397,7 +395,6 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
|
||||
cairo_surface_set_device_scale (image, buffer_scale, buffer_scale);
|
||||
|
||||
framebuffer = paint_data->tmp_framebuffer;
|
||||
glBindFramebuffer (GL_FRAMEBUFFER, framebuffer);
|
||||
|
||||
if (source_type == GL_RENDERBUFFER)
|
||||
@ -428,6 +425,8 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
|
||||
glBindFramebuffer (GL_FRAMEBUFFER, 0);
|
||||
|
||||
glDeleteFramebuffers (1, &framebuffer);
|
||||
|
||||
cairo_surface_mark_dirty (image);
|
||||
|
||||
cairo_set_source_surface (cr, image, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user