From 75db4f0ece194b7aa0455509785a300784778ec4 Mon Sep 17 00:00:00 2001 From: M Joonas Pihlaja Date: Mon, 22 Feb 2010 02:26:47 +0200 Subject: [PATCH] text: Fix assert failure from compositing by SOURCE with a mask internally. Change the operator used to upgrade the format of a glyph mask from CAIRO_OPERATOR_SOURCE to CAIRO_OPERATOR_ADD. The _cairo_scaled_font_show_glyphs() function upgrades the pixel format of a glyph mask by calling _cairo_surface_composite() to copy the mask to an image surface of the upgraded destination. The way it was doing it however was to use CAIRO_OPERATOR_SOURCE, a white source pattern and the glyph's rasterised glyph as the mask pattern. This combination isn't supported by _cairo_surface_composite(), which asserts that no mask is present when the operator is SOURCE or CLEAR. Reported by Mikael Magnusson to #cairo on irc.freenode.net. --- src/cairo-scaled-font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c index 7a556a798..480488fb9 100644 --- a/src/cairo-scaled-font.c +++ b/src/cairo-scaled-font.c @@ -2163,7 +2163,7 @@ _cairo_scaled_font_show_glyphs (cairo_scaled_font_t *scaled_font, /* Note that we only upgrade masks, i.e. A1 -> A8 -> ARGB32, so there is * never any component alpha here. */ - status = _cairo_surface_composite (CAIRO_OPERATOR_SOURCE, + status = _cairo_surface_composite (CAIRO_OPERATOR_ADD, &_cairo_pattern_white.base, &mask_pattern.base, new_mask,