From 01799bf0523d11e1bdb239caa265ce40cdcdfafa Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Mon, 17 Jan 2011 10:25:30 +0100 Subject: [PATCH] Fix optimization of white IN dest compositing The optimization of any opaque color IN an alpha-only surface is a noop (it multiplies the alpha of each pixel of the destination by 1). The same does not apply to colored destinations, because IN replaces the original color with the color of the source. Fixes white-in-noop. --- src/cairo-surface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 36eaa7904..b9d9e1661 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -1899,7 +1899,8 @@ _cairo_surface_fill_region (cairo_surface_t *surface, /* catch a common reduction of _cairo_clip_combine_with_surface() */ if (op == CAIRO_OPERATOR_IN && - _cairo_color_equal (color, CAIRO_COLOR_WHITE)) + surface->content == CAIRO_CONTENT_ALPHA && + CAIRO_COLOR_IS_OPAQUE (color)) { return CAIRO_STATUS_SUCCESS; }