[cairo] [PATCH] gl/spans: Handle SOURCE operations with opaque sources.

Martin Robinson mrobinson at igalia.com
Wed Feb 6 13:18:24 PST 2013


commit 74006ed8b8cd847a4df4f9c4468960cc24bfd6c2
Author: Ravi Nanjundappa <ravi.nanjundappa at gmail.com>
Date:   Mon Feb 6 10:56:55 2012 +0530

    gl/spans: Handle SOURCE operations with opaque sources.

    SOURCE operations with an opaque are equivalent to OVER.
    This can prevent us from falling back in certain cases.

diff --git a/src/cairo-gl-spans-compositor.c
b/src/cairo-gl-spans-compositor.c
index 98efd46..1700783 100644
--- a/src/cairo-gl-spans-compositor.c
+++ b/src/cairo-gl-spans-compositor.c
@@ -431,6 +431,13 @@ _cairo_gl_span_renderer_init
(cairo_abstract_span_renderer_t	*_r,
     cairo_operator_t op = composite->op;
     cairo_int_status_t status;

+    if (op == CAIRO_OPERATOR_SOURCE) {
+	if (! _cairo_pattern_is_opaque (&composite->source_pattern.base,
+					&composite->source_sample_area))
+	    return CAIRO_INT_STATUS_UNSUPPORTED;
+	op = CAIRO_OPERATOR_OVER;
+    }
+
     /* XXX earlier! */
     if (op == CAIRO_OPERATOR_CLEAR) {
 	source = &_cairo_pattern_white.base;


More information about the cairo mailing list