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

Emmanuel Pacaud emmanuel at kemper.freedesktop.org
Fri Apr 14 13:11:31 PDT 2006


 src/cairo-svg-surface.c |   11 +++++++++++
 1 files changed, 11 insertions(+)

New commits:
diff-tree f919ba858f405aa5c1cc64e7c25c3de5ffbce88f (from 8f3c60096d88b3c0368970273828e7a011c5e9dd)
Author: Emmanuel Pacaud <emmanuel.pacaud at free.fr>
Date:   Fri Apr 14 22:06:28 2006 +0200

    SVG: Emulate CLEAR and SOURCE operators on paint call when no clipping region is defined.

diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c
index d5c45eb..5c1eeb6 100644
--- a/src/cairo-svg-surface.c
+++ b/src/cairo-svg-surface.c
@@ -1007,6 +1007,17 @@ _cairo_svg_surface_paint (void		    *abs
 			  cairo_pattern_t   *source)
 {
     cairo_svg_surface_t *surface = abstract_surface;
+    
+    /* Emulation of clear and source operators, when no clipping region
+     * is defined. We just delete existing content of surface root node,
+     * and exit early if operator is clear. */ 
+    if (surface->clip_level == 0 &&
+	(op == CAIRO_OPERATOR_CLEAR ||
+	 op == CAIRO_OPERATOR_SOURCE)) {
+	    xmlFreeNode (surface->xml_root_node->children);
+	    if (op == CAIRO_OPERATOR_CLEAR)
+		    return CAIRO_STATUS_SUCCESS;
+    }
 
     emit_paint (surface->xml_node, surface, op, source);
     


More information about the cairo-commit mailing list