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.
This commit is contained in:
Andrea Canciani 2011-01-17 10:25:30 +01:00
parent 9e6d8ff86c
commit 01799bf052

View file

@ -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;
}