diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-07 11:56:38 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-07 11:58:39 +0000 |
commit | cff0097954657a459707e2af30c0bc49643cd289 (patch) | |
tree | 2ce90af8798f70d4225d3fe8d1a5253ec50347a2 | |
parent | 5613b210fffccd74dc2c3039ca0f1b628e306411 (diff) |
gl: Prevent leak of the white source used with glyph masks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/cairo-gl-glyphs.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cairo-gl-glyphs.c b/src/cairo-gl-glyphs.c index ca33e647..63678ff6 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; |