[cairo-commit] doc/public src/cairo-svg-surface.c test/cairo-test.c

Emmanuel Pacaud emmanuel at kemper.freedesktop.org
Sun Apr 16 06:42:56 PDT 2006


 doc/public/tmpl/cairo-beos.sgml         |    3 +
 doc/public/tmpl/cairo-font-options.sgml |    3 +
 doc/public/tmpl/cairo-font.sgml         |    3 +
 doc/public/tmpl/cairo-ft.sgml           |    3 +
 doc/public/tmpl/cairo-glitz.sgml        |    3 +
 doc/public/tmpl/cairo-image.sgml        |    3 +
 doc/public/tmpl/cairo-matrix.sgml       |    3 +
 doc/public/tmpl/cairo-paths.sgml        |    3 +
 doc/public/tmpl/cairo-pattern.sgml      |    3 +
 doc/public/tmpl/cairo-pdf.sgml          |    3 +
 doc/public/tmpl/cairo-png.sgml          |    3 +
 doc/public/tmpl/cairo-ps.sgml           |    3 +
 doc/public/tmpl/cairo-quartz.sgml       |    3 +
 doc/public/tmpl/cairo-scaled-font.sgml  |    3 +
 doc/public/tmpl/cairo-status.sgml       |    3 +
 doc/public/tmpl/cairo-surface.sgml      |    3 +
 doc/public/tmpl/cairo-text.sgml         |    3 +
 doc/public/tmpl/cairo-transforms.sgml   |    3 +
 doc/public/tmpl/cairo-types.sgml        |    3 +
 doc/public/tmpl/cairo-version.sgml      |    3 +
 doc/public/tmpl/cairo-win32-fonts.sgml  |    3 +
 doc/public/tmpl/cairo-win32.sgml        |    3 +
 doc/public/tmpl/cairo-xcb-xrender.sgml  |    3 +
 doc/public/tmpl/cairo-xcb.sgml          |    3 +
 doc/public/tmpl/cairo-xlib-xrender.sgml |    3 +
 doc/public/tmpl/cairo-xlib.sgml         |    3 +
 doc/public/tmpl/cairo.sgml              |    3 +
 src/cairo-svg-surface.c                 |   69 +++++++++++++++++++++++++-------
 test/cairo-test.c                       |   36 ++++++++++++++--
 29 files changed, 167 insertions(+), 19 deletions(-)

New commits:
diff-tree 714bb88832f0e6324cd4737aaa37a4ba39f8d14e (from d0356a87f7b274a0721c2644c4a62a8424923eb9)
Author: Emmanuel Pacaud <emmanuel.pacaud at free.fr>
Date:   Sun Apr 16 15:42:49 2006 +0200

    SVG: Add support for CAIRO_CONTENT_COLOR in create_similar.
    
    Also add support for testing this feature in test/cairo-test.c
    And a bunch of unwanted commit of sgml files.

diff --git a/doc/public/tmpl/cairo-beos.sgml b/doc/public/tmpl/cairo-beos.sgml
index b3ea139..707d7e1 100644
--- a/doc/public/tmpl/cairo-beos.sgml
+++ b/doc/public/tmpl/cairo-beos.sgml
@@ -14,3 +14,6 @@ BeOS surface support
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo-font-options.sgml b/doc/public/tmpl/cairo-font-options.sgml
index f800642..e87b550 100644
--- a/doc/public/tmpl/cairo-font-options.sgml
+++ b/doc/public/tmpl/cairo-font-options.sgml
@@ -14,6 +14,9 @@ How a font should be rendered
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### TYPEDEF cairo_font_options_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-font.sgml b/doc/public/tmpl/cairo-font.sgml
index fff13cd..b65281e 100644
--- a/doc/public/tmpl/cairo-font.sgml
+++ b/doc/public/tmpl/cairo-font.sgml
@@ -14,6 +14,9 @@ Base class for fonts
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### TYPEDEF cairo_font_face_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-ft.sgml b/doc/public/tmpl/cairo-ft.sgml
index d5ee69c..275f7af 100644
--- a/doc/public/tmpl/cairo-ft.sgml
+++ b/doc/public/tmpl/cairo-ft.sgml
@@ -14,3 +14,6 @@ Font support for FreeType
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo-glitz.sgml b/doc/public/tmpl/cairo-glitz.sgml
index 0d204de..437c71e 100644
--- a/doc/public/tmpl/cairo-glitz.sgml
+++ b/doc/public/tmpl/cairo-glitz.sgml
@@ -14,3 +14,6 @@ OpenGL accelerated rendering using the G
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo-image.sgml b/doc/public/tmpl/cairo-image.sgml
index 761627e..8e8dc86 100644
--- a/doc/public/tmpl/cairo-image.sgml
+++ b/doc/public/tmpl/cairo-image.sgml
@@ -17,6 +17,9 @@ Rendering to memory buffers
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### ENUM cairo_format_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-matrix.sgml b/doc/public/tmpl/cairo-matrix.sgml
index 19b3abc..3effbd2 100644
--- a/doc/public/tmpl/cairo-matrix.sgml
+++ b/doc/public/tmpl/cairo-matrix.sgml
@@ -29,6 +29,9 @@ Generic matrix operations
     
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT cairo_matrix_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-paths.sgml b/doc/public/tmpl/cairo-paths.sgml
index b06bc0e..01bf12d 100644
--- a/doc/public/tmpl/cairo-paths.sgml
+++ b/doc/public/tmpl/cairo-paths.sgml
@@ -14,6 +14,9 @@ Creating paths and manipulating path dat
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT cairo_path_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-pattern.sgml b/doc/public/tmpl/cairo-pattern.sgml
index 8319858..f7f29b1 100644
--- a/doc/public/tmpl/cairo-pattern.sgml
+++ b/doc/public/tmpl/cairo-pattern.sgml
@@ -14,6 +14,9 @@ Gradients and filtered sources
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### TYPEDEF cairo_pattern_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-pdf.sgml b/doc/public/tmpl/cairo-pdf.sgml
index efef4a6..4f7dbd7 100644
--- a/doc/public/tmpl/cairo-pdf.sgml
+++ b/doc/public/tmpl/cairo-pdf.sgml
@@ -14,3 +14,6 @@ Rendering PDF documents
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo-png.sgml b/doc/public/tmpl/cairo-png.sgml
index d2d6d38..cba1516 100644
--- a/doc/public/tmpl/cairo-png.sgml
+++ b/doc/public/tmpl/cairo-png.sgml
@@ -14,6 +14,9 @@ Reading and writing PNG images
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### USER_FUNCTION cairo_read_func_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-ps.sgml b/doc/public/tmpl/cairo-ps.sgml
index 087f464..a3d5765 100644
--- a/doc/public/tmpl/cairo-ps.sgml
+++ b/doc/public/tmpl/cairo-ps.sgml
@@ -14,3 +14,6 @@ Rendering PostScript documents
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo-quartz.sgml b/doc/public/tmpl/cairo-quartz.sgml
index 226dabe..02a69d9 100644
--- a/doc/public/tmpl/cairo-quartz.sgml
+++ b/doc/public/tmpl/cairo-quartz.sgml
@@ -14,3 +14,6 @@ Rendering to Quartz surfaces
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo-scaled-font.sgml b/doc/public/tmpl/cairo-scaled-font.sgml
index 9202ade..0656454 100644
--- a/doc/public/tmpl/cairo-scaled-font.sgml
+++ b/doc/public/tmpl/cairo-scaled-font.sgml
@@ -14,6 +14,9 @@ Caching metrics for a particular font si
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### TYPEDEF cairo_scaled_font_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-status.sgml b/doc/public/tmpl/cairo-status.sgml
index 1a9d86f..de5f35f 100644
--- a/doc/public/tmpl/cairo-status.sgml
+++ b/doc/public/tmpl/cairo-status.sgml
@@ -14,6 +14,9 @@ Decoding cairo's status
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### ENUM cairo_status_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-surface.sgml b/doc/public/tmpl/cairo-surface.sgml
index bbd829d..69d63d2 100644
--- a/doc/public/tmpl/cairo-surface.sgml
+++ b/doc/public/tmpl/cairo-surface.sgml
@@ -14,6 +14,9 @@ Base class for surfaces
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### TYPEDEF cairo_surface_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-text.sgml b/doc/public/tmpl/cairo-text.sgml
index 8514789..56678b1 100644
--- a/doc/public/tmpl/cairo-text.sgml
+++ b/doc/public/tmpl/cairo-text.sgml
@@ -14,6 +14,9 @@ Rendering text and sets of glyphs
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### STRUCT cairo_glyph_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-transforms.sgml b/doc/public/tmpl/cairo-transforms.sgml
index 14351e2..65199c8 100644
--- a/doc/public/tmpl/cairo-transforms.sgml
+++ b/doc/public/tmpl/cairo-transforms.sgml
@@ -14,3 +14,6 @@ Manipulating the current transformation 
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo-types.sgml b/doc/public/tmpl/cairo-types.sgml
index 66a3098..9e6f6b5 100644
--- a/doc/public/tmpl/cairo-types.sgml
+++ b/doc/public/tmpl/cairo-types.sgml
@@ -14,6 +14,9 @@ Generic data types used in the cairo API
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### FUNCTION cairo_bool_t ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-version.sgml b/doc/public/tmpl/cairo-version.sgml
index 329a2f4..42eb58e 100644
--- a/doc/public/tmpl/cairo-version.sgml
+++ b/doc/public/tmpl/cairo-version.sgml
@@ -114,6 +114,9 @@ if (cairo_version() >= %CAIRO_VERSION_EN
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### MACRO CAIRO_VERSION ##### -->
 <para>
 
diff --git a/doc/public/tmpl/cairo-win32-fonts.sgml b/doc/public/tmpl/cairo-win32-fonts.sgml
index d686ace..3652ccb 100644
--- a/doc/public/tmpl/cairo-win32-fonts.sgml
+++ b/doc/public/tmpl/cairo-win32-fonts.sgml
@@ -14,3 +14,6 @@ Font support for Microsoft Windows
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo-win32.sgml b/doc/public/tmpl/cairo-win32.sgml
index 6cc1cd8..b486ba8 100644
--- a/doc/public/tmpl/cairo-win32.sgml
+++ b/doc/public/tmpl/cairo-win32.sgml
@@ -14,3 +14,6 @@ Microsoft Windows surface support
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo-xcb-xrender.sgml b/doc/public/tmpl/cairo-xcb-xrender.sgml
index 635fa3c..fc24323 100644
--- a/doc/public/tmpl/cairo-xcb-xrender.sgml
+++ b/doc/public/tmpl/cairo-xcb-xrender.sgml
@@ -14,3 +14,6 @@ X Window System rendering using the XCB 
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo-xcb.sgml b/doc/public/tmpl/cairo-xcb.sgml
index 635fa3c..fc24323 100644
--- a/doc/public/tmpl/cairo-xcb.sgml
+++ b/doc/public/tmpl/cairo-xcb.sgml
@@ -14,3 +14,6 @@ X Window System rendering using the XCB 
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo-xlib-xrender.sgml b/doc/public/tmpl/cairo-xlib-xrender.sgml
index df970a2..c99d784 100644
--- a/doc/public/tmpl/cairo-xlib-xrender.sgml
+++ b/doc/public/tmpl/cairo-xlib-xrender.sgml
@@ -14,3 +14,6 @@ XLib/Xrender Backend
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo-xlib.sgml b/doc/public/tmpl/cairo-xlib.sgml
index 7480fad..f931a50 100644
--- a/doc/public/tmpl/cairo-xlib.sgml
+++ b/doc/public/tmpl/cairo-xlib.sgml
@@ -14,3 +14,6 @@ X Window System rendering using XLib
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
diff --git a/doc/public/tmpl/cairo.sgml b/doc/public/tmpl/cairo.sgml
index 32fd94f..04480e7 100644
--- a/doc/public/tmpl/cairo.sgml
+++ b/doc/public/tmpl/cairo.sgml
@@ -24,6 +24,9 @@ The cairo drawing context
 
 </para>
 
+<!-- ##### SECTION Stability_Level ##### -->
+
+
 <!-- ##### TYPEDEF cairo_t ##### -->
 <para>
 
diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c
index accbe00..eb01214 100644
--- a/src/cairo-svg-surface.c
+++ b/src/cairo-svg-surface.c
@@ -80,6 +80,8 @@ struct cairo_svg_document {
 struct cairo_svg_surface {
     cairo_surface_t base;
 
+    cairo_content_t content;
+
     unsigned int id;
 
     double width;
@@ -112,8 +114,9 @@ _cairo_svg_document_reference (cairo_svg
 
 static cairo_surface_t *
 _cairo_svg_surface_create_for_document (cairo_svg_document_t	*document,
-					double			width,
-					double			height);
+					cairo_content_t		 content,
+					double			 width,
+					double			 height);
 
 static const cairo_surface_backend_t cairo_svg_surface_backend;
 
@@ -129,7 +132,8 @@ _cairo_svg_surface_create_for_stream_int
     if (document == NULL)
       return NULL;
 
-    surface = _cairo_svg_surface_create_for_document (document, width, height);
+    surface = _cairo_svg_surface_create_for_document (document, CAIRO_CONTENT_COLOR_ALPHA, 
+						      width, height);
 
     document->owner = surface;
     _cairo_svg_document_destroy (document);
@@ -234,11 +238,12 @@ cairo_svg_surface_set_dpi (cairo_surface
 
 static cairo_surface_t *
 _cairo_svg_surface_create_for_document (cairo_svg_document_t	*document,
-					double			width,
-					double			height)
+					cairo_content_t		 content,
+					double			 width,
+					double			 height)
 {
     cairo_svg_surface_t *surface;
-    xmlNodePtr clip, clip_rect;
+    xmlNodePtr clip, rect;
     int clip_id;
     char buffer[CAIRO_SVG_DTOSTR_BUFFER_LEN];
 
@@ -262,11 +267,11 @@ _cairo_svg_surface_create_for_document (
     clip = xmlNewChild (document->xml_node_defs, NULL, CC2XML ("clipPath"), NULL);
     snprintf (buffer, sizeof buffer, "clip%d", clip_id);
     xmlSetProp (clip, CC2XML ("id"), C2XML (buffer));
-    clip_rect = xmlNewChild (clip, NULL, CC2XML ("rect"), NULL);
+    rect = xmlNewChild (clip, NULL, CC2XML ("rect"), NULL);
     _cairo_dtostr (buffer, sizeof buffer, width);
-    xmlSetProp (clip_rect, CC2XML ("width"), C2XML (buffer));
+    xmlSetProp (rect, CC2XML ("width"), C2XML (buffer));
     _cairo_dtostr (buffer, sizeof buffer, height);
-    xmlSetProp (clip_rect, CC2XML ("height"), C2XML (buffer));
+    xmlSetProp (rect, CC2XML ("height"), C2XML (buffer));
     
     surface->xml_node = xmlNewNode (NULL, CC2XML ("g"));
     surface->xml_root_node = surface->xml_node;
@@ -276,9 +281,19 @@ _cairo_svg_surface_create_for_document (
     snprintf (buffer, sizeof buffer, "url(#clip%d)", clip_id);
     xmlSetProp (surface->xml_node, CC2XML ("clip-path"), C2XML (buffer));
 
+    if (content == CAIRO_CONTENT_COLOR) {
+	rect = xmlNewChild (surface->xml_node, NULL, CC2XML ("rect"), NULL);
+	_cairo_dtostr (buffer, sizeof buffer, width);
+	xmlSetProp (rect, CC2XML ("width"), C2XML (buffer));
+	_cairo_dtostr (buffer, sizeof buffer, height);
+	xmlSetProp (rect, CC2XML ("height"), C2XML (buffer));
+	xmlSetProp (rect, CC2XML ("style"), CC2XML ("opacity:1; stroke:none; fill:rgb(0,0,0);"));
+    }
+
     surface->modified = TRUE;
     surface->previous_id = surface->id;
-    
+    surface->content = content;
+
     return &surface->base;
 }
 
@@ -290,8 +305,12 @@ _cairo_svg_surface_create_similar (void	
 {
     cairo_svg_surface_t *template = abstract_src;
 
+    if (content != CAIRO_CONTENT_COLOR_ALPHA &&
+	content != CAIRO_CONTENT_COLOR)
+	    return (cairo_surface_t *) &_cairo_surface_nil;
+
     return _cairo_svg_surface_create_for_document (template->document,
-						   width, height);
+						   content, width, height);
 }
 
 static cairo_status_t
@@ -524,7 +543,8 @@ emit_composite_svg_pattern (xmlNodePtr n
 	    xmlAddChild (document->xml_node_defs, xmlCopyNode (surface->xml_root_node, 1));
     
     child = xmlNewChild (node, NULL, CC2XML("use"), NULL);
-    snprintf (buffer, sizeof buffer, "#surface%d", surface->previous_id);
+    snprintf (buffer, sizeof buffer, "#surface%d", 
+	      surface->modified ? surface->id : surface->previous_id);
     xmlSetProp (child, CC2XML ("xlink:href"), C2XML (buffer));
 
     if (!is_pattern) {
@@ -1061,9 +1081,28 @@ _cairo_svg_surface_paint (void		    *abs
     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;
+	xmlNodePtr child = surface->xml_root_node->children;
+	
+	while (child != NULL) {
+	    xmlUnlinkNode (child);
+	    xmlFreeNode (child);
+	    child = surface->xml_root_node->children;
+	}
+
+	if (op == CAIRO_OPERATOR_CLEAR) {
+	    if (surface->content == CAIRO_CONTENT_COLOR) {
+		xmlNodePtr rect;
+		char buffer[CAIRO_SVG_DTOSTR_BUFFER_LEN];
+
+		rect = xmlNewChild (surface->xml_node, NULL, CC2XML ("rect"), NULL);
+		_cairo_dtostr (buffer, sizeof buffer, surface->width);
+		xmlSetProp (rect, CC2XML ("width"), C2XML (buffer));
+		_cairo_dtostr (buffer, sizeof buffer, surface->height);
+		xmlSetProp (rect, CC2XML ("height"), C2XML (buffer));
+		xmlSetProp (rect, CC2XML ("style"), CC2XML ("opacity:1; stroke:none; fill:rgb(0,0,0);"));
+	    } 
+	    return CAIRO_STATUS_SUCCESS;
+	}
     }
 
     emit_paint (surface->xml_node, surface, op, source);
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 59b55f7..9105a1b 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1304,6 +1304,7 @@ typedef struct _svg_target_closure
 {
     char    *filename;
     int	    width, height;
+    cairo_surface_t	*target;
 } svg_target_closure_t;
 
 static cairo_surface_t *
@@ -1330,7 +1331,19 @@ create_svg_surface (cairo_test_t	 *test,
 	free (ptc);
 	return NULL;
     }
+    cairo_svg_surface_set_dpi (surface, 72., 72.);
+
+    if (content == CAIRO_CONTENT_COLOR) {
+	ptc->target = surface;
+	surface = cairo_surface_create_similar (ptc->target, 
+						CAIRO_CONTENT_COLOR,
+						width, height);
+    } else {
+	ptc->target = NULL;
+    }
+
     cairo_surface_set_user_data (surface, &svg_closure_key, ptc, NULL);
+
     return surface;
 }
 
@@ -1340,15 +1353,26 @@ svg_surface_write_to_png (cairo_surface_
     svg_target_closure_t *ptc = cairo_surface_get_user_data (surface, &svg_closure_key);
     char    command[4096];
 
-    cairo_surface_finish (surface);
+    if (ptc->target) {
+	cairo_t *cr;
+	cr = cairo_create (ptc->target);
+	cairo_set_source_surface (cr, surface, 0, 0);
+	cairo_paint (cr);
+	cairo_show_page (cr);
+	cairo_destroy (cr);
+
+	cairo_surface_finish (surface);
+	surface = ptc->target;
+    }
 
+    cairo_surface_finish (surface);
     sprintf (command, "./svg2png %s %s",
 	     ptc->filename, filename);
 
     if (system (command) != 0)
 	return CAIRO_STATUS_WRITE_ERROR;
     
-    return CAIRO_STATUS_WRITE_ERROR;
+    return CAIRO_STATUS_SUCCESS;
 }
 
 static void
@@ -1593,10 +1617,14 @@ cairo_test_expecting (cairo_test_t *test
 		create_pdf_surface, pdf_surface_write_to_png, cleanup_pdf },
 #endif
 #if CAIRO_HAS_SVG_SURFACE && CAIRO_CAN_TEST_SVG_SURFACE
-	    { "svg", CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR,
-		    create_svg_surface, svg_surface_write_to_png, cleanup_svg },
 	    { "svg", CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR_ALPHA,
 		    create_svg_surface, svg_surface_write_to_png, cleanup_svg },
+
+	    /* A SVG surface is COLOR_APLHA by default, and currently a create
+	     * similar with content != COLOR_ALPHA will return a nil surface.
+	     * So don't test COLOR for now. */
+	    { "svg", CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR,
+		    create_svg_surface, svg_surface_write_to_png, cleanup_svg },
 #endif
 #if CAIRO_HAS_BEOS_SURFACE
 	    { "beos", CAIRO_SURFACE_TYPE_BEOS, CAIRO_CONTENT_COLOR,


More information about the cairo-commit mailing list