diff options
author | M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> | 2010-02-22 02:26:47 +0200 |
---|---|---|
committer | M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> | 2010-02-22 02:29:00 +0200 |
commit | 75db4f0ece194b7aa0455509785a300784778ec4 (patch) | |
tree | a15cb1dbca7f524ff887105f405c36c35dc04995 | |
parent | 20f8f17f0e494a57a6b413be76f9333b42d88014 (diff) |
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.
-rw-r--r-- | src/cairo-scaled-font.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c index 7a556a79..480488fb 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, |