summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2012-11-07 14:35:25 -0800
committerBehdad Esfahbod <behdad@behdad.org>2015-06-19 14:21:12 -0700
commite07dd7b96307f0d3b4f0fd563773b6bc1c68f686 (patch)
treec87a14f8b8d5ca428a71caf37d2493817b15b0e5
parente7acf4b6dc6666c2a2c54fb08e9ad6f01a1d415f (diff)
WIP Adjust image compositor for color emoji bitmap glyphs
These are non-component-alpha, and should be used as src, not mask.
-rw-r--r--src/cairo-image-compositor.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c
index 48072f81b..f15dd6ce3 100644
--- a/src/cairo-image-compositor.c
+++ b/src/cairo-image-compositor.c
@@ -1179,10 +1179,12 @@ composite_glyphs (void *_dst,
TRACE ((stderr, "%s\n", __FUNCTION__));
- if (info->num_glyphs == 1)
+ /* XXX */
+ if (0 && info->num_glyphs == 1)
return composite_one_glyph(_dst, op, _src, src_x, src_y, dst_x, dst_y, info);
- if (info->use_mask)
+ /* XXX */
+ if (0 && info->use_mask)
return composite_glyphs_via_mask(_dst, op, _src, src_x, src_y, dst_x, dst_y, info);
op = _pixman_operator (op);
@@ -1222,12 +1224,21 @@ composite_glyphs (void *_dst,
y = _cairo_lround (info->glyphs[i].y -
glyph_surface->base.device_transform.y0);
- pixman_image_composite32 (op, src, glyph_surface->pixman_image, dst,
- x + src_x, y + src_y,
- 0, 0,
- x - dst_x, y - dst_y,
- glyph_surface->width,
- glyph_surface->height);
+ if (glyph_surface->format != CAIRO_FORMAT_ARGB32 ||
+ pixman_image_get_component_alpha (glyph_surface->pixman_image))
+ pixman_image_composite32 (op, src, glyph_surface->pixman_image, dst,
+ x + src_x, y + src_y,
+ 0, 0,
+ x - dst_x, y - dst_y,
+ glyph_surface->width,
+ glyph_surface->height);
+ else /* Color glyph. */
+ pixman_image_composite32 (op, glyph_surface->pixman_image, NULL, dst,
+ 0, 0,
+ x + src_x, y + src_y,
+ x - dst_x, y - dst_y,
+ glyph_surface->width,
+ glyph_surface->height);
}
}