diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-23 14:57:35 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-23 14:57:35 +0000 |
commit | e217677ce6a3f853144d1bc2b33423e1e0a64773 (patch) | |
tree | e49f35119b4303a03926198df44b83105d9c24a5 /src/cairo-xlib-render-compositor.c | |
parent | 44a868b552f0cbf22f35e8a4e4e0daee555344a3 (diff) | |
download | cairo-e217677ce6a3f853144d1bc2b33423e1e0a64773.tar.gz |
xlib: ADD only reduces to SOURCE for alpha-only targets
Fixes operator.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-xlib-render-compositor.c')
-rw-r--r-- | src/cairo-xlib-render-compositor.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cairo-xlib-render-compositor.c b/src/cairo-xlib-render-compositor.c index 4088281de..5dd7668d6 100644 --- a/src/cairo-xlib-render-compositor.c +++ b/src/cairo-xlib-render-compositor.c @@ -313,8 +313,12 @@ fill_reduces_to_source (cairo_operator_t op, const cairo_color_t *color, cairo_xlib_surface_t *dst) { - if (dst->base.is_clear || CAIRO_COLOR_IS_OPAQUE (color)) - return op == CAIRO_OPERATOR_OVER || op == CAIRO_OPERATOR_ADD; + if (dst->base.is_clear || CAIRO_COLOR_IS_OPAQUE (color)) { + if (op == CAIRO_OPERATOR_OVER) + return TRUE; + if (op == CAIRO_OPERATOR_ADD) + return (dst->base.content & CAIRO_CONTENT_COLOR) == 0; + } return FALSE; } |