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

Martin Robinson <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
commit 74006ed8b8cd847a4df4f9c4468960cc24bfd6c2
Author: Ravi Nanjundappa <[email protected]>
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;
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.