[cairo-commit] src/cairo-pdf-surface.c

Adrian Johnson ajohnson at kemper.freedesktop.org
Mon Feb 25 03:29:20 PST 2008


 src/cairo-pdf-surface.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 7c8c9cf334b8687ffe2d6f614e234bd1662689e6
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Feb 25 21:50:37 2008 +1030

    PDF: Support OPERATOR_SOURCE when pattern is opaque

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index c376a95..d5a86df 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -4129,10 +4129,14 @@ _cairo_pdf_surface_analyze_operation (cairo_pdf_surface_t  *surface,
     if (op == CAIRO_OPERATOR_OVER)
 	return CAIRO_STATUS_SUCCESS;
 
-    /* The SOURCE operator is only if there is nothing painted
-     * underneath. */
-    if (op == CAIRO_OPERATOR_SOURCE)
-	return CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY;
+    /* The SOURCE operator supported if the pattern is opaque or if
+     * there is nothing painted underneath. */
+    if (op == CAIRO_OPERATOR_SOURCE) {
+	if (_cairo_pattern_is_opaque (pattern))
+	    return CAIRO_STATUS_SUCCESS;
+	else
+	    return CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY;
+    }
 
     return CAIRO_INT_STATUS_UNSUPPORTED;
 }


More information about the cairo-commit mailing list