[cairo-commit] cairo/src cairo-svg-surface.c,1.6,1.7

Emmanuel Pacaud commit at pdx.freedesktop.org
Fri Dec 30 14:16:12 PST 2005


Committed by: emmanuel

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv23109/src

Modified Files:
	cairo-svg-surface.c 
Log Message:
2005-12-30  Emmanuel Pacaud <emmanuel.pacaud at free.fr>

	* src/cairo-svg-surface.c (_cairo_svg_surface_create_for_document): no
	more has_clip boolean. Init clip_level.
	(_cairo_surface_intersect_clip_path): a NULL path means reset of
	clipping region, not back to previous clipping level.



Index: cairo-svg-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-svg-surface.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cairo-svg-surface.c	28 Dec 2005 10:28:57 -0000	1.6
+++ cairo-svg-surface.c	30 Dec 2005 22:16:10 -0000	1.7
@@ -88,7 +88,7 @@
 
     xmlNodePtr  xml_node;
 
-    cairo_bool_t has_clip;
+    unsigned int clip_level;
 };
 
 static cairo_svg_document_t *
@@ -194,7 +194,7 @@
     _cairo_svg_document_reference (document);
     surface->document = document;
 
-    surface->has_clip = FALSE;
+    surface->clip_level = 0;
 
     surface->id = document->surface_id++;
     clip_id = document->clip_id++;
@@ -1303,14 +1303,13 @@
     char buffer[CAIRO_SVG_DTOSTR_BUFFER_LEN];
 
     if (path == NULL) {
-	if (surface->has_clip)
+	while (surface->clip_level > 0) {
 	    surface->xml_node = surface->xml_node->parent;
-	surface->has_clip = FALSE;
+	    surface->clip_level--;
+	}
 	return CAIRO_STATUS_SUCCESS;
     }
 
-    surface->has_clip = TRUE;
-
     if (path != NULL) {
 	info.document = document;
 	info.has_current_point = FALSE;
@@ -1340,6 +1339,7 @@
 
 	document->clip_id++;
 	surface->xml_node = group;
+	surface->clip_level++;
     } 
 
     return status;



More information about the cairo-commit mailing list