diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-06 22:16:12 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-07 10:02:31 +0000 |
commit | 4b54c09c056e5dee65f2cf4e87835eb9127e5b1c (patch) | |
tree | 65d4a08e3c37bec53c131341f8937263034243eb | |
parent | 400ea9c2905461067df9e6d27c2e961d47f04676 (diff) |
image: Substitute OVER spans for SOURCE with an opaque pattern
Based on an idea from Ravi Nanjundappa
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/cairo-image-compositor.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c index 150efdb2..be3db984 100644 --- a/src/cairo-image-compositor.c +++ b/src/cairo-image-compositor.c @@ -2933,11 +2933,19 @@ span_renderer_init (cairo_abstract_span_renderer_t *_r, op == CAIRO_OPERATOR_ADD)) { op = PIXMAN_OP_SRC; } else if (op == CAIRO_OPERATOR_SOURCE) { + if (_cairo_pattern_is_opaque (&composite->source_pattern.base, + &composite->source_sample_area)) + { + op = PIXMAN_OP_OVER; + } + else + { #if PIXMAN_HAS_OP_LERP - op = PIXMAN_OP_LERP_SRC; + op = PIXMAN_OP_LERP_SRC; #else - return CAIRO_INT_STATUS_UNSUPPORTED; + return CAIRO_INT_STATUS_UNSUPPORTED; #endif + } } else { op = _pixman_operator (op); } |