summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Song <henry.song@samsung.com>2013-07-03 12:22:55 -0700
committerMartin Robinson <mrobinson@igalia.com>2013-07-15 19:27:19 -0700
commitbe2c09a1f59ad677a2b4718d26687873093b466c (patch)
tree6f0bf2fd67618f27efc643ce48eafbe17a6d334d
parent2cc353c3dbe01b4d8f65d6de800f2b1d6004a1c2 (diff)
gl/msaa: Properly destroy stencil buffer clip cache
When replacing the stencil buffer clip cache or destroying a surface, destroy the cached clip. This prevents the clip from leaking.
-rw-r--r--src/cairo-gl-composite.c5
-rw-r--r--src/cairo-gl-surface.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c
index 68c9b80ca..b77197936 100644
--- a/src/cairo-gl-composite.c
+++ b/src/cairo-gl-composite.c
@@ -584,8 +584,11 @@ _cairo_gl_composite_setup_painted_clipping (cairo_gl_composite_t *setup,
/* Clear the stencil buffer, but only the areas that we are
* going to be drawing to. */
- if (old_clip)
+ if (old_clip) {
_cairo_gl_scissor_to_rectangle (dst, _cairo_clip_get_extents (old_clip));
+ _cairo_clip_destroy (setup->dst->clip_on_stencil_buffer);
+ }
+
setup->dst->clip_on_stencil_buffer = _cairo_clip_copy (setup->clip);
}
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index d7a7836bf..f6b7928b7 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -1033,6 +1033,8 @@ _cairo_gl_surface_finish (void *abstract_surface)
ctx->dispatch.DeleteRenderbuffers (1, &surface->msaa_rb);
#endif
+ _cairo_clip_destroy (surface->clip_on_stencil_buffer);
+
return _cairo_gl_context_release (ctx, status);
}