[cairo-commit] src/cairo-gl-glyphs.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Dec 7 04:07:31 PST 2011


 src/cairo-gl-glyphs.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit cff0097954657a459707e2af30c0bc49643cd289
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Dec 7 11:56:38 2011 +0000

    gl: Prevent leak of the white source used with glyph masks
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-gl-glyphs.c b/src/cairo-gl-glyphs.c
index ca33e64..63678ff 100644
--- a/src/cairo-gl-glyphs.c
+++ b/src/cairo-gl-glyphs.c
@@ -229,9 +229,13 @@ render_glyphs (cairo_gl_surface_t	*dst,
     if (unlikely (status))
 	goto FINISH;
 
-    _cairo_gl_composite_set_source_operand (&setup,
-					    source_to_operand (source));
+    if (source == NULL) {
+	    _cairo_gl_composite_set_solid_source (&setup, CAIRO_COLOR_WHITE);
+    } else {
+	    _cairo_gl_composite_set_source_operand (&setup,
+						    source_to_operand (source));
 
+    }
     for (i = 0; i < info->num_glyphs; i++) {
 	cairo_scaled_glyph_t *scaled_glyph;
 	cairo_gl_glyph_t *glyph;
@@ -344,8 +348,7 @@ render_glyphs_via_mask (cairo_gl_surface_t *dst,
     }
 
     status = render_glyphs ((cairo_gl_surface_t *) mask, 0, 0,
-			    CAIRO_OPERATOR_ADD,
-			    _cairo_gl_white_source (),
+			    CAIRO_OPERATOR_ADD, NULL,
 			    info, &has_component_alpha);
     if (likely (status == CAIRO_STATUS_SUCCESS)) {
 	cairo_surface_pattern_t mask_pattern;


More information about the cairo-commit mailing list