[cairo-commit] 16 commits - boilerplate/cairo-boilerplate.c configure.in .gitignore perf/Makefile.am src/cairo-analysis-surface.c src/cairo-ft-font.c src/cairoint.h src/cairo-paginated-surface.c src/cairo-path-bounds.c src/cairo-pattern.c src/cairo-pdf-operators.c src/cairo-pdf-operators-private.h src/cairo-pdf-surface.c src/cairo-types-private.h test/Makefile.am test/solid-pattern-cache-stress.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Jan 10 10:02:24 PST 2008


 .gitignore                        |    1 
 boilerplate/cairo-boilerplate.c   |    2 
 configure.in                      |   35 +++-
 perf/Makefile.am                  |    8 
 src/cairo-analysis-surface.c      |   12 -
 src/cairo-ft-font.c               |    2 
 src/cairo-paginated-surface.c     |    2 
 src/cairo-path-bounds.c           |    8 
 src/cairo-pattern.c               |   14 +
 src/cairo-pdf-operators-private.h |    3 
 src/cairo-pdf-operators.c         |   39 ++--
 src/cairo-pdf-surface.c           |  296 ++++++++++++++++++++++++-----------
 src/cairo-types-private.h         |  169 ++++++++++++++++++++
 src/cairoint.h                    |  170 --------------------
 test/Makefile.am                  |  313 +++++++++++++++++++-------------------
 test/solid-pattern-cache-stress.c |   12 +
 16 files changed, 617 insertions(+), 469 deletions(-)

New commits:
commit 10f6ef98f645d9f9f54d88fcf18683771258d36f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 17:50:45 2008 +0000

    [gitignore] Add mkinstalldirs.
    
    Ignore another autoconf utility script.

diff --git a/.gitignore b/.gitignore
index a1de0d6..dc908aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,7 @@ depcomp
 install-sh
 libtool
 ltmain.sh
+mkinstalldirs
 missing
 releases
 stamp-h
commit da769b53e89b1f1ff91886a12a388e5fadec47bb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 17:23:56 2008 +0000

    [configure.in] Fixup usage of _CHECK_FUNCS_WITH_FLAGS within PKG_CHECK_MODULE.
    
    An unwanted side-effect of the recent fix for the paranoid extra check
    for a usable library was that it broke the logic for the absence of the
    module.

diff --git a/configure.in b/configure.in
index 43abc3d..024b675 100644
--- a/configure.in
+++ b/configure.in
@@ -513,7 +513,8 @@ CAIRO_BACKEND_ENABLE(ft, FreeType font, freetype, FT_FONT, auto, [
   ft_REQUIRES="fontconfig"
   PKG_CHECK_MODULES(FONTCONFIG, $ft_REQUIRES,
 		    [_CHECK_FUNCS_WITH_FLAGS(FcFini, [$FONTCONFIG_CFLAGS], [$FONTCONFIG_LIBS],,
-		    [AC_MSG_RESULT(no); use_ft="no (requires fontconfig)"])])
+		    [AC_MSG_RESULT(no); use_ft="no (requires fontconfig)"])],
+		    [AC_MSG_RESULT(no); use_ft="no (requires fontconfig)"])
 
   if test "x$use_ft" = "xyes"; then
     PKG_CHECK_MODULES(FREETYPE, freetype2 >= $FREETYPE_MIN_VERSION,
@@ -625,8 +626,8 @@ if test "x$use_pdf" = "xyes"; then
   PKG_CHECK_MODULES(POPPLER, $poppler_DEPENDENCY pango gtk+-2.0,
 		    [_CHECK_FUNCS_WITH_FLAGS(poppler_page_render_to_pixbuf, [$POPPLER_CFLAGS], [$POPPLER_LIBS],
                     [test_pdf=yes],
-		    [AC_MSG_RESULT(no)
-		     test_pdf="no (requires $poppler_DEPENDENCY)"])])
+		    [AC_MSG_RESULT(no); test_pdf="no (requires $poppler_DEPENDENCY)"])],
+		    [AC_MSG_RESULT(no); test_pdf="no (requires $poppler_DEPENDENCY)"])
   if test "x$test_pdf" = "xyes"; then
     AC_DEFINE([CAIRO_CAN_TEST_PDF_SURFACE], 1, [Define to 1 if the PDF backend can be tested (need poppler and other dependencies for pdf2png)])
   else
@@ -655,8 +656,8 @@ if test "x$use_svg" = "xyes"; then
   PKG_CHECK_MODULES(LIBRSVG, $librsvg_DEPENDENCY gdk-2.0,
 		    [_CHECK_FUNCS_WITH_FLAGS(rsvg_pixbuf_from_file, [$LIBRSVG_CFLAGS], [$LIBRSVG_LIBS],
                     [test_svg=yes],
-		    [AC_MSG_RESULT(no)
-		     test_svg="no (requires $librsvg_DEPENDENCY)"])])
+		    [AC_MSG_RESULT(no); test_svg="no (requires $librsvg_DEPENDENCY)"])],
+		    [AC_MSG_RESULT(no); test_svg="no (requires $librsvg_DEPENDENCY)"])
   if test "x$test_svg" = "xyes"; then
     AC_DEFINE([CAIRO_CAN_TEST_SVG_SURFACE], 1, [Define to 1 if the SVG backend can be tested])
   else
commit 409e91b576ad992b41c66c952931c4a3e652dbf9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 15:53:54 2008 +0000

    [cairo-pdf-surface] Review error handling.
    
    Ensure all errors are propagated back to the caller with locally
    allocated resources destroy as required.

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 8b3a2bf..29c2c41 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -159,7 +159,7 @@ _cairo_pdf_smask_group_destroy (cairo_pdf_smask_group_t *group);
 static cairo_status_t
 _cairo_pdf_surface_add_font (unsigned int        font_id,
 			     unsigned int        subset_id,
-			     void 		*closure);
+			     void		*closure);
 
 static void
 _cairo_pdf_group_resources_init (cairo_pdf_group_resources_t *res);
@@ -574,7 +574,7 @@ _cairo_pdf_surface_add_xobject (cairo_pdf_surface_t  *surface,
 static cairo_status_t
 _cairo_pdf_surface_add_font (unsigned int        font_id,
 			     unsigned int        subset_id,
-			     void 		*closure)
+			     void		*closure)
 {
     cairo_pdf_surface_t *surface = closure;
     cairo_pdf_font_t font;
@@ -618,7 +618,6 @@ _cairo_pdf_surface_get_font_resource (cairo_pdf_surface_t *surface,
 {
     cairo_pdf_font_t font;
     int num_fonts, i;
-    cairo_pdf_resource_t resource;
 
     num_fonts = _cairo_array_num_elements (&surface->fonts);
     for (i = 0; i < num_fonts; i++) {
@@ -626,9 +625,9 @@ _cairo_pdf_surface_get_font_resource (cairo_pdf_surface_t *surface,
 	if (font.font_id == font_id && font.subset_id == subset_id)
 	    return font.subset_resource;
     }
-    resource.id = 0;
 
-    return resource;
+    font.subset_resource.id = 0;
+    return font.subset_resource;
 }
 
 static void
@@ -716,9 +715,9 @@ _cairo_pdf_surface_emit_group_resources (cairo_pdf_surface_t         *surface,
 }
 
 static cairo_pdf_smask_group_t *
-_cairo_pdf_surface_create_smask_group (cairo_pdf_surface_t 	*surface)
+_cairo_pdf_surface_create_smask_group (cairo_pdf_surface_t	*surface)
 {
-    cairo_pdf_smask_group_t 	*group;
+    cairo_pdf_smask_group_t	*group;
 
     group = calloc (1, sizeof (cairo_pdf_smask_group_t));
     if (group == NULL) {
@@ -758,12 +757,13 @@ _cairo_pdf_surface_add_smask_group (cairo_pdf_surface_t     *surface,
 }
 
 static cairo_status_t
-_cairo_pdf_surface_add_pdf_pattern (cairo_pdf_surface_t 	*surface,
-				    cairo_pattern_t     	*pattern,
-				    cairo_pdf_resource_t 	*pattern_res,
-				    cairo_pdf_resource_t 	*gstate_res)
+_cairo_pdf_surface_add_pdf_pattern (cairo_pdf_surface_t		*surface,
+				    cairo_pattern_t		*pattern,
+				    cairo_pdf_resource_t	*pattern_res,
+				    cairo_pdf_resource_t	*gstate_res)
 {
     cairo_pdf_pattern_t pdf_pattern;
+    cairo_status_t status;
 
     /* Solid colors are emitted into the content stream */
     if (pattern->type == CAIRO_PATTERN_TYPE_SOLID) {
@@ -785,8 +785,10 @@ _cairo_pdf_surface_add_pdf_pattern (cairo_pdf_surface_t 	*surface,
 
     pdf_pattern.pattern = cairo_pattern_reference (pattern);
     pdf_pattern.pattern_res = _cairo_pdf_surface_new_object (surface);
-    if (pdf_pattern.pattern_res.id == 0)
+    if (pdf_pattern.pattern_res.id == 0) {
+	cairo_pattern_destroy (pattern);
 	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+    }
 
     pdf_pattern.gstate_res.id = 0;
 
@@ -795,15 +797,23 @@ _cairo_pdf_surface_add_pdf_pattern (cairo_pdf_surface_t 	*surface,
         pattern->type == CAIRO_PATTERN_TYPE_RADIAL) {
         if (_cairo_pattern_is_opaque (pattern) == FALSE) {
             pdf_pattern.gstate_res = _cairo_pdf_surface_new_object (surface);
-            if (pdf_pattern.gstate_res.id == 0)
-                return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+	    if (pdf_pattern.gstate_res.id == 0) {
+		cairo_pattern_destroy (pattern);
+		return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+	    }
         }
     }
 
     *pattern_res = pdf_pattern.pattern_res;
     *gstate_res = pdf_pattern.gstate_res;
 
-    return _cairo_array_append (&surface->patterns, &pdf_pattern);
+    status = _cairo_array_append (&surface->patterns, &pdf_pattern);
+    if (status) {
+	cairo_pattern_destroy (pattern);
+	return status;
+    }
+
+    return CAIRO_STATUS_SUCCESS;
 }
 
 static cairo_pdf_resource_t
@@ -1016,7 +1026,7 @@ static cairo_status_t
 _cairo_pdf_surface_close_group (cairo_pdf_surface_t *surface,
 				cairo_pdf_resource_t *group)
 {
-    cairo_status_t status;
+    cairo_status_t status = CAIRO_STATUS_SUCCESS, status2;
 
     assert (surface->pdf_stream.active == FALSE);
     assert (surface->group_stream.active == TRUE);
@@ -1024,8 +1034,6 @@ _cairo_pdf_surface_close_group (cairo_pdf_surface_t *surface,
     if (surface->compress_content) {
 	status = _cairo_output_stream_destroy (surface->group_stream.stream);
 	surface->group_stream.stream = NULL;
-	if (status)
-	    return status;
 
 	_cairo_output_stream_printf (surface->group_stream.mem_stream,
 				     "\r\n");
@@ -1041,7 +1049,10 @@ _cairo_pdf_surface_close_group (cairo_pdf_surface_t *surface,
     if (group)
 	*group = surface->group_stream.resource;
 
-    status = _cairo_output_stream_destroy (surface->group_stream.mem_stream);
+    status2 =  _cairo_output_stream_destroy (surface->group_stream.mem_stream);
+    if (status == CAIRO_STATUS_SUCCESS)
+	status = status2;
+
     surface->group_stream.mem_stream = NULL;
     surface->group_stream.stream = NULL;
 
@@ -1077,15 +1088,17 @@ _cairo_pdf_surface_open_content_stream (cairo_pdf_surface_t  *surface,
 					    surface->width,
 					    surface->height,
 					    surface->content_resources.id);
+	if (resource->id == 0)
+	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
     } else {
 	surface->content =
 	    _cairo_pdf_surface_open_stream (surface,
 					    NULL,
 					    surface->compress_content,
 					    NULL);
+	if (surface->content.id == 0)
+	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
     }
-    if (surface->content.id == 0)
-	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
     _cairo_output_stream_printf (surface->output, "q\r\n");
 
@@ -1128,12 +1141,14 @@ _cairo_pdf_surface_create_similar (void			*abstract_surface,
 static cairo_status_t
 _cairo_pdf_surface_finish (void *abstract_surface)
 {
-    cairo_status_t status = CAIRO_STATUS_SUCCESS, status2;
     cairo_pdf_surface_t *surface = abstract_surface;
     long offset;
     cairo_pdf_resource_t info, catalog;
+    cairo_status_t status, status2;
 
-    status = _cairo_pdf_surface_emit_font_subsets (surface);
+    status = surface->base.status;
+    if (status == CAIRO_STATUS_SUCCESS)
+	status = _cairo_pdf_surface_emit_font_subsets (surface);
 
     _cairo_pdf_surface_write_pages (surface);
 
@@ -1609,7 +1624,7 @@ _cairo_pdf_surface_emit_meta_surface (cairo_pdf_surface_t  *surface,
 
 static cairo_status_t
 _cairo_pdf_surface_emit_surface_pattern (cairo_pdf_surface_t	*surface,
-					 cairo_pdf_pattern_t 	*pdf_pattern)
+					 cairo_pdf_pattern_t	*pdf_pattern)
 {
     cairo_surface_pattern_t *pattern = (cairo_surface_pattern_t *) pdf_pattern->pattern;
     cairo_status_t status = CAIRO_STATUS_SUCCESS;
@@ -1743,24 +1758,27 @@ _cairo_pdf_surface_emit_surface_pattern (cairo_pdf_surface_t	*surface,
     cairo_matrix_scale (&pdf_p2d, 1.0, -1.0);
 
     _cairo_pdf_surface_update_object (surface, pdf_pattern->pattern_res);
-    _cairo_pdf_surface_open_stream (surface,
-				    &pdf_pattern->pattern_res,
-				    FALSE,
-				    "   /PatternType 1\r\n"
-				    "   /BBox [0 0 %d %d]\r\n"
-				    "   /XStep %f\r\n"
-				    "   /YStep %f\r\n"
-				    "   /TilingType 1\r\n"
-				    "   /PaintType 1\r\n"
-				    "   /Matrix [ %f %f %f %f %f %f ]\r\n"
-				    "   /Resources << /XObject << /x%d %d 0 R >> >>\r\n",
-				    bbox_x, bbox_y,
-				    xstep, ystep,
-				    pdf_p2d.xx, pdf_p2d.yx,
-				    pdf_p2d.xy, pdf_p2d.yy,
-				    pdf_p2d.x0, pdf_p2d.y0,
-				    pattern_resource.id,
-				    pattern_resource.id);
+    if (_cairo_pdf_surface_open_stream (surface,
+				        &pdf_pattern->pattern_res,
+					FALSE,
+					"   /PatternType 1\r\n"
+					"   /BBox [0 0 %d %d]\r\n"
+					"   /XStep %f\r\n"
+					"   /YStep %f\r\n"
+					"   /TilingType 1\r\n"
+					"   /PaintType 1\r\n"
+					"   /Matrix [ %f %f %f %f %f %f ]\r\n"
+					"   /Resources << /XObject << /x%d %d 0 R >> >>\r\n",
+					bbox_x, bbox_y,
+					xstep, ystep,
+					pdf_p2d.xx, pdf_p2d.yx,
+					pdf_p2d.xy, pdf_p2d.yy,
+					pdf_p2d.x0, pdf_p2d.y0,
+					pattern_resource.id,
+					pattern_resource.id).id == 0)
+    {
+	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+    }
 
     if (_cairo_surface_is_meta (pattern->surface)) {
 	if (extend == CAIRO_EXTEND_REFLECT) {
@@ -1906,7 +1924,7 @@ cairo_pdf_surface_emit_alpha_linear_function (cairo_pdf_surface_t    *surface,
 
 static cairo_status_t
 _cairo_pdf_surface_emit_stitched_colorgradient (cairo_pdf_surface_t    *surface,
-                                                unsigned int 	        n_stops,
+                                                unsigned int	        n_stops,
                                                 cairo_pdf_color_stop_t *stops,
                                                 cairo_bool_t	        is_alpha,
                                                 cairo_pdf_resource_t   *function)
@@ -1953,7 +1971,7 @@ _cairo_pdf_surface_emit_stitched_colorgradient (cairo_pdf_surface_t    *surface,
         _cairo_output_stream_printf (surface->output,
                                      "%d 0 R ", stops[i].resource.id);
     _cairo_output_stream_printf (surface->output,
-		    		 "]\r\n");
+				 "]\r\n");
 
     _cairo_output_stream_printf (surface->output,
 				 "   /Bounds [ ");
@@ -1961,7 +1979,7 @@ _cairo_pdf_surface_emit_stitched_colorgradient (cairo_pdf_surface_t    *surface,
         _cairo_output_stream_printf (surface->output,
 				     "%f ", stops[i].offset);
     _cairo_output_stream_printf (surface->output,
-		    		 "]\r\n");
+				 "]\r\n");
 
     _cairo_output_stream_printf (surface->output,
 				 "   /Encode [ ");
@@ -1969,10 +1987,10 @@ _cairo_pdf_surface_emit_stitched_colorgradient (cairo_pdf_surface_t    *surface,
         _cairo_output_stream_printf (surface->output,
 				     "0 1 ");
     _cairo_output_stream_printf (surface->output,
-	    			 "]\r\n");
+				 "]\r\n");
 
     _cairo_output_stream_printf (surface->output,
-	    			 ">>\r\n"
+				 ">>\r\n"
 				 "endobj\r\n");
 
     *function = res;
@@ -2428,11 +2446,14 @@ _cairo_pdf_surface_emit_linear_pattern (cairo_pdf_surface_t    *surface,
         if (status)
             return status;
 
-	cairo_pdf_surface_emit_transparency_group (surface,
-						   pdf_pattern->gstate_res,
-						   mask_resource);
+	status = cairo_pdf_surface_emit_transparency_group (surface,
+						            pdf_pattern->gstate_res,
+							    mask_resource);
+	if (status)
+	    return status;
     }
-    return status;
+
+    return CAIRO_STATUS_SUCCESS;
 }
 
 static cairo_status_t
@@ -2542,12 +2563,14 @@ _cairo_pdf_surface_emit_radial_pattern (cairo_pdf_surface_t    *surface,
                                      ">>\r\n"
                                      "endobj\r\n");
 
-	cairo_pdf_surface_emit_transparency_group (surface,
-						   pdf_pattern->gstate_res,
-						   mask_resource);
+	status = cairo_pdf_surface_emit_transparency_group (surface,
+						            pdf_pattern->gstate_res,
+							    mask_resource);
+	if (status)
+	    return status;
     }
 
-    return status;
+    return CAIRO_STATUS_SUCCESS;
 }
 
 static cairo_status_t
@@ -3160,7 +3183,7 @@ _cairo_pdf_surface_emit_type1_font_subset (cairo_pdf_surface_t		*surface,
     char name[64];
 
     snprintf (name, sizeof name, "CairoFont-%d-%d",
- 	      font_subset->font_id, font_subset->subset_id);
+	      font_subset->font_id, font_subset->subset_id);
     status = _cairo_type1_subset_init (&subset, name, font_subset, FALSE);
     if (status)
 	return status;
@@ -3382,8 +3405,9 @@ _cairo_pdf_surface_emit_bitmap_glyph (cairo_pdf_surface_t	*surface,
     image = scaled_glyph->surface;
     if (image->format != CAIRO_FORMAT_A1) {
 	image = _cairo_image_surface_clone (image, CAIRO_FORMAT_A1);
-	if (cairo_surface_status (&image->base))
-	    return cairo_surface_status (&image->base);
+	status = cairo_surface_status (&image->base);
+	if (status)
+	    return status;
     }
 
     *glyph_ret = _cairo_pdf_surface_open_stream (surface,
@@ -3464,12 +3488,12 @@ _cairo_pdf_surface_emit_type3_font_subset (cairo_pdf_surface_t		*surface,
 
     glyphs = _cairo_malloc_ab (font_subset->num_glyphs, sizeof (cairo_pdf_resource_t));
     if (glyphs == NULL)
-	return _cairo_surface_set_error (&surface->base, CAIRO_STATUS_NO_MEMORY);
+	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
     widths = _cairo_malloc_ab (font_subset->num_glyphs, sizeof (double));
     if (widths == NULL) {
         free (glyphs);
-	return _cairo_surface_set_error (&surface->base, CAIRO_STATUS_NO_MEMORY);
+	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
     }
 
     for (i = 0; i < font_subset->num_glyphs; i++) {
@@ -3722,8 +3746,8 @@ _cairo_pdf_surface_write_xref (cairo_pdf_surface_t *surface)
 }
 
 static cairo_status_t
-_cairo_pdf_surface_write_mask_group (cairo_pdf_surface_t 	*surface,
-				     cairo_pdf_smask_group_t 	*group)
+_cairo_pdf_surface_write_mask_group (cairo_pdf_surface_t	*surface,
+				     cairo_pdf_smask_group_t	*group)
 {
     cairo_pdf_resource_t mask_group;
     cairo_pdf_resource_t smask;
@@ -3745,17 +3769,24 @@ _cairo_pdf_surface_write_mask_group (cairo_pdf_surface_t 	*surface,
     if (gstate_res.id != 0) {
 	smask_group = _cairo_pdf_surface_create_smask_group (surface);
 	if (smask_group == NULL)
-	    return CAIRO_STATUS_NO_MEMORY;
+	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
 	smask_group->operation = PDF_PAINT;
 	smask_group->source = cairo_pattern_reference (group->mask);
 	smask_group->source_res = pattern_res;
 	status = _cairo_pdf_surface_add_smask_group (surface, smask_group);
-	if (status)
+	if (status) {
+	    _cairo_pdf_smask_group_destroy (smask_group);
 	    return status;
+	}
 
 	status = _cairo_pdf_surface_add_smask (surface, gstate_res);
+	if (status)
+	    return status;
+
 	status = _cairo_pdf_surface_add_xobject (surface, smask_group->group_res);
+	if (status)
+	    return status;
 
 	_cairo_output_stream_printf (surface->output,
 				     "q /s%d gs /x%d Do Q\r\n",
@@ -3791,17 +3822,24 @@ _cairo_pdf_surface_write_mask_group (cairo_pdf_surface_t 	*surface,
     if (gstate_res.id != 0) {
 	smask_group = _cairo_pdf_surface_create_smask_group (surface);
 	if (smask_group == NULL)
-	    return CAIRO_STATUS_NO_MEMORY;
+	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
 	smask_group->operation = PDF_PAINT;
 	smask_group->source = cairo_pattern_reference (group->source);
 	smask_group->source_res = pattern_res;
 	status = _cairo_pdf_surface_add_smask_group (surface, smask_group);
-	if (status)
+	if (status) {
+	    _cairo_pdf_smask_group_destroy (smask_group);
 	    return status;
+	}
 
 	status = _cairo_pdf_surface_add_smask (surface, gstate_res);
+	if (status)
+	    return status;
+
 	status = _cairo_pdf_surface_add_xobject (surface, smask_group->group_res);
+	if (status)
+	    return status;
 
 	_cairo_output_stream_printf (surface->output,
 				     "q /s%d gs /x%d Do Q\r\n",
@@ -3970,12 +4008,16 @@ _cairo_pdf_surface_write_page (cairo_pdf_surface_t *surface)
 	    _cairo_output_stream_printf (surface->output,
 					 "/x%d Do\r\n",
 					 res.id);
-	    _cairo_pdf_surface_add_xobject (surface, res);
+	    status = _cairo_pdf_surface_add_xobject (surface, res);
+	    if (status)
+		return status;
 	}
 	_cairo_output_stream_printf (surface->output,
 				     "/x%d Do\r\n",
 				     surface->content.id);
-	_cairo_pdf_surface_add_xobject (surface, surface->content);
+	status = _cairo_pdf_surface_add_xobject (surface, surface->content);
+	if (status)
+	    return status;
 
 	status = _cairo_pdf_surface_close_group (surface, &knockout);
 	if (status)
@@ -3983,11 +4025,19 @@ _cairo_pdf_surface_write_page (cairo_pdf_surface_t *surface)
 
 	_cairo_pdf_group_resources_clear (&surface->resources);
 	status = _cairo_pdf_surface_open_content_stream (surface, &surface->content, FALSE);
+	if (status)
+	    return status;
+
 	_cairo_output_stream_printf (surface->output,
 				     "/x%d Do\r\n",
 				     knockout.id);
-	_cairo_pdf_surface_add_xobject (surface, knockout);
-	_cairo_pdf_surface_close_content_stream (surface);
+	status = _cairo_pdf_surface_add_xobject (surface, knockout);
+	if (status)
+	    return status;
+
+	status = _cairo_pdf_surface_close_content_stream (surface);
+	if (status)
+	    return status;
     }
 
     page = _cairo_pdf_surface_new_object (surface);
@@ -4019,7 +4069,9 @@ _cairo_pdf_surface_write_page (cairo_pdf_surface_t *surface)
     if (status)
 	return status;
 
-    _cairo_pdf_surface_write_patterns_and_smask_groups (surface);
+    status = _cairo_pdf_surface_write_patterns_and_smask_groups (surface);
+    if (status)
+	return status;
 
     return CAIRO_STATUS_SUCCESS;
 }
@@ -4202,17 +4254,24 @@ _cairo_pdf_surface_paint (void			*abstract_surface,
     if (gstate_res.id != 0) {
 	group = _cairo_pdf_surface_create_smask_group (surface);
 	if (group == NULL)
-	    return CAIRO_STATUS_NO_MEMORY;
+	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
 	group->operation = PDF_PAINT;
 	group->source = cairo_pattern_reference (source);
 	group->source_res = pattern_res;
 	status = _cairo_pdf_surface_add_smask_group (surface, group);
-	if (status)
+	if (status) {
+	    _cairo_pdf_smask_group_destroy (group);
 	    return status;
+	}
 
 	status = _cairo_pdf_surface_add_smask (surface, gstate_res);
+	if (status)
+	    return status;
+
 	status = _cairo_pdf_surface_add_xobject (surface, group->group_res);
+	if (status)
+	    return status;
 
 	_cairo_output_stream_printf (surface->output,
 				     "q /s%d gs /x%d Do Q\r\n",
@@ -4265,21 +4324,30 @@ _cairo_pdf_surface_mask	(void			*abstract_surface,
 
     group = _cairo_pdf_surface_create_smask_group (surface);
     if (group == NULL)
-	return CAIRO_STATUS_NO_MEMORY;
+	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
     group->operation = PDF_MASK;
     group->source = cairo_pattern_reference (source);
     group->mask = cairo_pattern_reference (mask);
     group->source_res = _cairo_pdf_surface_new_object (surface);
-    if (group->source_res.id == 0)
+    if (group->source_res.id == 0) {
+	_cairo_pdf_smask_group_destroy (group);
 	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+    }
 
     status = _cairo_pdf_surface_add_smask_group (surface, group);
-    if (status)
+    if (status) {
+	_cairo_pdf_smask_group_destroy (group);
 	return status;
+    }
 
     status = _cairo_pdf_surface_add_smask (surface, group->group_res);
+    if (status)
+	return status;
+
     status = _cairo_pdf_surface_add_xobject (surface, group->source_res);
+    if (status)
+	return status;
 
     _cairo_output_stream_printf (surface->output,
 				 "q /s%d gs /x%d Do Q\r\n",
@@ -4321,24 +4389,33 @@ _cairo_pdf_surface_stroke (void			*abstract_surface,
     if (gstate_res.id != 0) {
 	group = _cairo_pdf_surface_create_smask_group (surface);
 	if (group == NULL)
-	    return CAIRO_STATUS_NO_MEMORY;
+	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
 	group->operation = PDF_STROKE;
 	group->source = cairo_pattern_reference (source);
 	group->source_res = pattern_res;
 	status = _cairo_path_fixed_init_copy (&group->path, path);
-	if (status)
+	if (status) {
+	    _cairo_pdf_smask_group_destroy (group);
 	    return status;
+	}
 
 	group->style = style;
 	group->ctm = *ctm;
 	group->ctm_inverse = *ctm_inverse;
 	status = _cairo_pdf_surface_add_smask_group (surface, group);
-	if (status)
+	if (status) {
+	    _cairo_pdf_smask_group_destroy (group);
 	    return status;
+	}
 
 	status = _cairo_pdf_surface_add_smask (surface, gstate_res);
+	if (status)
+	    return status;
+
 	status = _cairo_pdf_surface_add_xobject (surface, group->group_res);
+	if (status)
+	    return status;
 
 	_cairo_output_stream_printf (surface->output,
 				     "q /s%d gs /x%d Do Q\r\n",
@@ -4398,22 +4475,31 @@ _cairo_pdf_surface_fill (void			*abstract_surface,
     if (gstate_res.id != 0) {
 	group = _cairo_pdf_surface_create_smask_group (surface);
 	if (group == NULL)
-	    return CAIRO_STATUS_NO_MEMORY;
+	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
 	group->operation = PDF_FILL;
 	group->source = cairo_pattern_reference (source);
 	group->source_res = pattern_res;
 	status = _cairo_path_fixed_init_copy (&group->path, path);
-	if (status)
+	if (status) {
+	    _cairo_pdf_smask_group_destroy (group);
 	    return status;
+	}
 
 	group->fill_rule = fill_rule;
 	status = _cairo_pdf_surface_add_smask_group (surface, group);
-	if (status)
+	if (status) {
+	    _cairo_pdf_smask_group_destroy (group);
 	    return status;
+	}
 
 	status = _cairo_pdf_surface_add_smask (surface, gstate_res);
+	if (status)
+	    return status;
+
 	status = _cairo_pdf_surface_add_xobject (surface, group->group_res);
+	if (status)
+	    return status;
 
 	_cairo_output_stream_printf (surface->output,
 				     "q /s%d gs /x%d Do Q\r\n",
@@ -4465,7 +4551,7 @@ _cairo_pdf_surface_show_glyphs (void			*abstract_surface,
     if (gstate_res.id != 0) {
 	group = _cairo_pdf_surface_create_smask_group (surface);
 	if (group == NULL)
-	    return CAIRO_STATUS_NO_MEMORY;
+	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
 
 	group->operation = PDF_SHOW_GLYPHS;
 	group->source = cairo_pattern_reference (source);
@@ -4474,11 +4560,18 @@ _cairo_pdf_surface_show_glyphs (void			*abstract_surface,
 	group->num_glyphs = num_glyphs;
 	group->scaled_font = cairo_scaled_font_reference (scaled_font);
 	status = _cairo_pdf_surface_add_smask_group (surface, group);
-	if (status)
+	if (status) {
+	    _cairo_pdf_smask_group_destroy (group);
 	    return status;
+	}
 
 	status = _cairo_pdf_surface_add_smask (surface, gstate_res);
+	if (status)
+	    return status;
+
 	status = _cairo_pdf_surface_add_xobject (surface, group->group_res);
+	if (status)
+	    return status;
 
 	_cairo_output_stream_printf (surface->output,
 				     "q /s%d gs /x%d Do Q\r\n",
commit 6134600988a6b5fcbc72f7897bfc83b37949b677
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jan 8 14:14:33 2008 +0000

    [cairo-pdf-surface] Skip emitting the font subset if not among resources.
    
    Do not emit the font_subset if we did not successfully add it to the list
    of font resources - can only happen after an error

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 40edb22..8b3a2bf 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -2859,6 +2859,12 @@ _cairo_pdf_surface_emit_cff_font (cairo_pdf_surface_t		*surface,
     unsigned int i;
     cairo_status_t status;
 
+    subset_resource = _cairo_pdf_surface_get_font_resource (surface,
+							    font_subset->font_id,
+							    font_subset->subset_id);
+    if (subset_resource.id == 0)
+	return CAIRO_STATUS_SUCCESS;
+
     compressed = compress_dup (subset->data, subset->data_length, &compressed_length);
     if (compressed == NULL)
 	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
@@ -2950,9 +2956,6 @@ _cairo_pdf_surface_emit_cff_font (cairo_pdf_surface_t		*surface,
 				 ">>\r\n"
 				 "endobj\r\n");
 
-    subset_resource = _cairo_pdf_surface_get_font_resource (surface,
-							    font_subset->font_id,
-							    font_subset->subset_id);
     _cairo_pdf_surface_update_object (surface, subset_resource);
     _cairo_output_stream_printf (surface->output,
 				 "%d 0 obj\r\n"
@@ -3036,6 +3039,11 @@ _cairo_pdf_surface_emit_type1_font (cairo_pdf_surface_t		*surface,
     char *compressed;
     unsigned int i;
 
+    subset_resource = _cairo_pdf_surface_get_font_resource (surface,
+							    font_subset->font_id,
+							    font_subset->subset_id);
+    if (subset_resource.id == 0)
+	return CAIRO_STATUS_SUCCESS;
 
     /* We ignore the zero-trailer and set Length3 to 0. */
     length = subset->header_length + subset->data_length;
@@ -3104,9 +3112,6 @@ _cairo_pdf_surface_emit_type1_font (cairo_pdf_surface_t		*surface,
 				 subset->descent,
 				 stream.id);
 
-    subset_resource = _cairo_pdf_surface_get_font_resource (surface,
-							    font_subset->font_id,
-							    font_subset->subset_id);
     _cairo_pdf_surface_update_object (surface, subset_resource);
     _cairo_output_stream_printf (surface->output,
 				 "%d 0 obj\r\n"
@@ -3202,6 +3207,12 @@ _cairo_pdf_surface_emit_truetype_font_subset (cairo_pdf_surface_t		*surface,
     char *compressed;
     unsigned int i;
 
+    subset_resource = _cairo_pdf_surface_get_font_resource (surface,
+							    font_subset->font_id,
+							    font_subset->subset_id);
+    if (subset_resource.id == 0)
+	return CAIRO_STATUS_SUCCESS;
+
     status = _cairo_truetype_subset_init (&subset, font_subset);
     if (status)
 	return status;
@@ -3308,9 +3319,6 @@ _cairo_pdf_surface_emit_truetype_font_subset (cairo_pdf_surface_t		*surface,
 				 ">>\r\n"
 				 "endobj\r\n");
 
-    subset_resource = _cairo_pdf_surface_get_font_resource (surface,
-							    font_subset->font_id,
-							    font_subset->subset_id);
     _cairo_pdf_surface_update_object (surface, subset_resource);
     _cairo_output_stream_printf (surface->output,
 				 "%d 0 obj\r\n"
@@ -3448,6 +3456,12 @@ _cairo_pdf_surface_emit_type3_font_subset (cairo_pdf_surface_t		*surface,
     if (font_subset->num_glyphs == 0)
 	return CAIRO_STATUS_SUCCESS;
 
+    subset_resource = _cairo_pdf_surface_get_font_resource (surface,
+							    font_subset->font_id,
+							    font_subset->subset_id);
+    if (subset_resource.id == 0)
+	return CAIRO_STATUS_SUCCESS;
+
     glyphs = _cairo_malloc_ab (font_subset->num_glyphs, sizeof (cairo_pdf_resource_t));
     if (glyphs == NULL)
 	return _cairo_surface_set_error (&surface->base, CAIRO_STATUS_NO_MEMORY);
@@ -3537,9 +3551,6 @@ _cairo_pdf_surface_emit_type3_font_subset (cairo_pdf_surface_t		*surface,
 	return status;
     }
 
-    subset_resource = _cairo_pdf_surface_get_font_resource (surface,
-							    font_subset->font_id,
-							    font_subset->subset_id);
     _cairo_pdf_surface_update_object (surface, subset_resource);
     matrix = font_subset->scaled_font->scale;
     status = cairo_matrix_invert (&matrix);
commit 755a4bb51b458fbc059b6306e371d9dc1c906b04
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 15:30:42 2008 +0000

    [test] Win32 printing backend testing depends upon ghostscript
    
    Using the Win32 printing backend requires ghostscript, so only enable
    those tests if we detect 'gs' during configure.

diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index aaf3433..e92e2a6 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -222,6 +222,7 @@ static cairo_boilerplate_target_t targets[] =
     { "win32", CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR_ALPHA, 0,
       _cairo_boilerplate_win32_create_surface,
       cairo_surface_write_to_png },
+#if CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE
     { "win32-printing", CAIRO_SURFACE_TYPE_WIN32_PRINTING,
       CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
       _cairo_boilerplate_win32_printing_create_surface,
@@ -234,6 +235,7 @@ static cairo_boilerplate_target_t targets[] =
       _cairo_boilerplate_win32_printing_cleanup,
       NULL, TRUE },
 #endif
+#endif
 #if CAIRO_HAS_XCB_SURFACE
     /* Acceleration architectures may make the results differ by a
      * bit, so we set the error tolerance to 1. */
diff --git a/configure.in b/configure.in
index 8da5902..43abc3d 100644
--- a/configure.in
+++ b/configure.in
@@ -364,6 +364,20 @@ CAIRO_BACKEND_ENABLE(win32_font, Microsoft Windows font, win32-font, WIN32_FONT,
   use_win32_font=$use_win32
 ])
 
+test_win32_printing=no
+if test "x$use_win32" = "xyes"; then
+  AC_CHECK_PROG(GS, gs, gs)
+  if test "$GS"; then
+    AC_DEFINE([CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE], 1, [Define to 1 if the Win32 Printing backend can be tested (needs ghostscript)])
+    test_win32_printing="yes"
+  else
+    AC_MSG_WARN([Win32 Printing backend will not be tested since ghostscript is not available])
+    test_win32_printing="no (requires ghostscript)"
+  fi
+fi
+
+AM_CONDITIONAL(CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE, test "x$test_win32_printing" = "xyes")
+
 dnl ===========================================================================
 
 CAIRO_BACKEND_ENABLE(os2, OS/2, os2, OS2_SURFACE, no, [
@@ -1028,6 +1042,9 @@ echo "  test surfaces: $use_test_surfaces"
 echo "  ps testing:    $test_ps"
 echo "  pdf testing:   $test_pdf"
 echo "  svg testing:   $test_svg"
+if test x"$use_win32" = "xyes"; then
+	echo "  win32 printing testing:    $test_win32_printing"
+fi
 echo ""
 echo "using CFLAGS:"
 echo $CAIRO_CFLAGS
commit 02b0743458655f44ffc4d429b4ac355df42071f1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 15:22:16 2008 +0000

    [cairo-pattern] Rearrange CAIRO_MUTEX_INITIALIZE.
    
    test/pattern-get-type exposes a bug whereby we try to acquire the
    _cairo_pattern_solid_pattern_cache_lock before initializing the
    mutexes. To fix this move the CAIRO_MUTEX_INITIALIZE() from the
    depths of _cairo_pattern_init() and perform it at the public entry
    points.

diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index f5d17dd..0c3ef4b 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -91,8 +91,6 @@ _cairo_pattern_set_error (cairo_pattern_t *pattern,
 static void
 _cairo_pattern_init (cairo_pattern_t *pattern, cairo_pattern_type_t type)
 {
-    CAIRO_MUTEX_INITIALIZE ();
-
     pattern->type      = type;
     CAIRO_REFERENCE_COUNT_INIT (&pattern->ref_count, 1);
     pattern->status    = CAIRO_STATUS_SUCCESS;
@@ -367,6 +365,8 @@ _cairo_pattern_create_in_error (cairo_status_t status)
     if (status == CAIRO_STATUS_NO_MEMORY)
 	return (cairo_pattern_t *)&_cairo_pattern_nil.base;
 
+    CAIRO_MUTEX_INITIALIZE ();
+
     pattern = _cairo_pattern_create_solid (_cairo_stock_color (CAIRO_STOCK_BLACK),
 					   CAIRO_CONTENT_COLOR);
     if (pattern->status == CAIRO_STATUS_SUCCESS)
@@ -407,6 +407,8 @@ cairo_pattern_create_rgb (double red, double green, double blue)
 
     _cairo_color_init_rgb (&color, red, green, blue);
 
+    CAIRO_MUTEX_INITIALIZE ();
+
     pattern = _cairo_pattern_create_solid (&color,
 					   CAIRO_CONTENT_COLOR);
     if (pattern->status)
@@ -451,6 +453,8 @@ cairo_pattern_create_rgba (double red, double green, double blue,
 
     _cairo_color_init_rgba (&color, red, green, blue, alpha);
 
+    CAIRO_MUTEX_INITIALIZE ();
+
     pattern = _cairo_pattern_create_solid (&color,
 					   CAIRO_CONTENT_COLOR_ALPHA);
     if (pattern->status)
@@ -492,6 +496,8 @@ cairo_pattern_create_for_surface (cairo_surface_t *surface)
 	return (cairo_pattern_t *)&_cairo_pattern_nil.base;
     }
 
+    CAIRO_MUTEX_INITIALIZE ();
+
     _cairo_pattern_init_for_surface (pattern, surface);
 
     return &pattern->base;
@@ -535,6 +541,8 @@ cairo_pattern_create_linear (double x0, double y0, double x1, double y1)
 	return (cairo_pattern_t *) &_cairo_pattern_nil.base;
     }
 
+    CAIRO_MUTEX_INITIALIZE ();
+
     _cairo_pattern_init_linear (pattern, x0, y0, x1, y1);
 
     return &pattern->base.base;
@@ -580,6 +588,8 @@ cairo_pattern_create_radial (double cx0, double cy0, double radius0,
 	return (cairo_pattern_t *) &_cairo_pattern_nil.base;
     }
 
+    CAIRO_MUTEX_INITIALIZE ();
+
     _cairo_pattern_init_radial (pattern, cx0, cy0, radius0, cx1, cy1, radius1);
 
     return &pattern->base.base;
commit cbe8d3855efd1254089c1c855c337df326ea52d7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 15:14:15 2008 +0000

    [test] Fixup make check for mingw
    
    Add EXEEXT to TESTS so that mingw builds the correct target.

diff --git a/perf/Makefile.am b/perf/Makefile.am
index 4701abf..78fdeb2 100644
--- a/perf/Makefile.am
+++ b/perf/Makefile.am
@@ -77,14 +77,14 @@ CAIRO_PERF_ENVIRONMENT = CAIRO_PERF_ITERATIONS="$(ITERS)" CAIRO_TEST_TARGET="$(T
 # Cap the maximum number of iterations during 'make check'
 TESTS_ENVIRONMENT = CAIRO_TEST_TARGET="$(TARGETS)" CAIRO_PERF_ITERATIONS="10"
 
-TESTS = cairo-perf
+TESTS = cairo-perf$(EXEEXT)
 
-perf: cairo-perf
-	$(CAIRO_PERF_ENVIRONMENT) ./cairo-perf
+perf: cairo-perf$(EXEEXT)
+	$(CAIRO_PERF_ENVIRONMENT) ./cairo-perf$(EXEEXT)
 
 html: index.html
 
-index.html: cairo-perf
+index.html: cairo-perf$(EXEEXT)
 	$(CAIRO_PERF_ENVIRONMENT) ./cairo-perf-diff -h HEAD > $@
 
 
diff --git a/test/Makefile.am b/test/Makefile.am
index 1489b7b..b462470 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,130 +1,130 @@
 SUBDIRS=pdiff .
 
 # Here are all the tests that are run unconditionally
-TESTS = 			\
-a8-mask				\
-big-trap			\
-caps-joins			\
-caps-joins-alpha		\
-caps-sub-paths			\
-clip-all			\
-clip-empty			\
-clip-fill-rule			\
-clip-fill-rule-pixel-aligned	\
-clip-nesting			\
-clip-operator			\
-clip-push-group			\
-clip-twice			\
-clip-zero \
-close-path			\
-composite-integer-translate-source \
-composite-integer-translate-over \
-composite-integer-translate-over-repeat \
-copy-path			\
-create-for-stream		\
-create-from-png			\
-create-from-png-stream		\
-dash-caps-joins			\
-dash-no-dash			\
-dash-offset-negative		\
-dash-scale			\
-dash-zero-length		\
-dash-state			\
-degenerate-path			\
-degenerate-pen			\
-device-offset			\
-device-offset-positive		\
-extend-pad			\
-fill-and-stroke			\
-fill-and-stroke-alpha		\
-fill-and-stroke-alpha-add	\
-fill-degenerate-sort-order	\
-fill-missed-stop		\
-fill-rule			\
-filter-nearest-offset		\
-font-face-get-type		\
-font-matrix-translation		\
-glyph-cache-pressure		\
-get-and-set			\
-get-clip                        \
-get-group-target		\
-get-path-extents                \
-gradient-alpha			\
-gradient-zero-stops \
-infinite-join			\
-in-fill-empty-trapezoid		\
-invalid-matrix			\
-leaky-dash			\
-leaky-polygon			\
-line-width			\
-line-width-scale		\
-line-width-zero			\
-linear-gradient			\
-linear-gradient-reflect		\
-long-lines			\
-mask				\
-mask-alpha			\
-mask-ctm			\
-mask-surface-ctm		\
-meta-surface-pattern            \
-miter-precision			\
-move-to-show-surface		\
-new-sub-path			\
-nil-surface			\
-operator-clear			\
-operator-source			\
-over-above-source		\
-over-around-source		\
-over-below-source		\
-over-between-source		\
-paint				\
-paint-repeat			\
-paint-source-alpha		\
-paint-with-alpha		\
-pattern-get-type		\
-pattern-getters			\
-pixman-rotate			\
-radial-gradient			\
-random-intersections		\
-rectangle-rounding-error	\
-rectilinear-stroke		\
-rgb24-ignore-alpha		\
-rotate-image-surface-paint	\
-scale-down-source-surface-paint	\
-scale-source-surface-paint	\
-select-font-face		\
-select-font-no-show-text	\
-self-copy			\
-self-intersecting		\
-set-source			\
-show-text-current-point		\
-skew-extreme			\
-solid-pattern-cache-stress	\
-source-clip			\
-source-clip-scale		\
-source-surface-scale-paint	\
-surface-finish-twice		\
-surface-pattern			\
-surface-pattern-big-scale-down  \
-surface-pattern-scale-down	\
-surface-pattern-scale-up	\
-text-antialias-gray		\
-text-antialias-none		\
-text-antialias-subpixel		\
-text-cache-crash		\
-text-pattern			\
-text-rotate			\
-text-zero-len			\
-transforms			\
-translate-show-surface		\
-trap-clip			\
-truetype-tables			\
-unantialiased-shapes		\
-unbounded-operator		\
-user-data			\
-rel-path                        \
-push-group			\
-zero-alpha
+TESTS =							\
+a8-mask$(EXEEXT)					\
+big-trap$(EXEEXT)					\
+caps-joins$(EXEEXT)					\
+caps-joins-alpha$(EXEEXT)				\
+caps-sub-paths$(EXEEXT)					\
+clip-all$(EXEEXT)					\
+clip-empty$(EXEEXT)					\
+clip-fill-rule$(EXEEXT)					\
+clip-fill-rule-pixel-aligned$(EXEEXT)			\
+clip-nesting$(EXEEXT)					\
+clip-operator$(EXEEXT)					\
+clip-push-group$(EXEEXT)				\
+clip-twice$(EXEEXT)					\
+clip-zero$(EXEEXT)					\
+close-path$(EXEEXT)					\
+composite-integer-translate-source$(EXEEXT)		\
+composite-integer-translate-over$(EXEEXT)		\
+composite-integer-translate-over-repeat$(EXEEXT)	\
+copy-path$(EXEEXT)					\
+create-for-stream$(EXEEXT)				\
+create-from-png$(EXEEXT)				\
+create-from-png-stream$(EXEEXT)				\
+dash-caps-joins$(EXEEXT)				\
+dash-no-dash$(EXEEXT)					\
+dash-offset-negative$(EXEEXT)				\
+dash-scale$(EXEEXT)					\
+dash-zero-length$(EXEEXT)				\
+dash-state$(EXEEXT)					\
+degenerate-path$(EXEEXT)				\
+degenerate-pen$(EXEEXT)					\
+device-offset$(EXEEXT)					\
+device-offset-positive$(EXEEXT)				\
+extend-pad$(EXEEXT)					\
+fill-and-stroke$(EXEEXT)				\
+fill-and-stroke-alpha$(EXEEXT)				\
+fill-and-stroke-alpha-add$(EXEEXT)			\
+fill-degenerate-sort-order$(EXEEXT)			\
+fill-missed-stop$(EXEEXT)				\
+fill-rule$(EXEEXT)					\
+filter-nearest-offset$(EXEEXT)				\
+font-face-get-type$(EXEEXT)				\
+font-matrix-translation$(EXEEXT)			\
+glyph-cache-pressure$(EXEEXT)				\
+get-and-set$(EXEEXT)					\
+get-clip$(EXEEXT)					\
+get-group-target$(EXEEXT)				\
+get-path-extents$(EXEEXT)				\
+gradient-alpha$(EXEEXT)					\
+gradient-zero-stops$(EXEEXT)				\
+infinite-join$(EXEEXT)					\
+in-fill-empty-trapezoid$(EXEEXT)			\
+invalid-matrix$(EXEEXT)					\
+leaky-dash$(EXEEXT)					\
+leaky-polygon$(EXEEXT)					\
+line-width$(EXEEXT)					\
+line-width-scale$(EXEEXT)				\
+line-width-zero$(EXEEXT)				\
+linear-gradient$(EXEEXT)				\
+linear-gradient-reflect$(EXEEXT)			\
+long-lines$(EXEEXT)					\
+mask$(EXEEXT)						\
+mask-alpha$(EXEEXT)					\
+mask-ctm$(EXEEXT)					\
+mask-surface-ctm$(EXEEXT)				\
+meta-surface-pattern$(EXEEXT)				\
+miter-precision$(EXEEXT)				\
+move-to-show-surface$(EXEEXT)				\
+new-sub-path$(EXEEXT)					\
+nil-surface$(EXEEXT)					\
+operator-clear$(EXEEXT)					\
+operator-source$(EXEEXT)				\
+over-above-source$(EXEEXT)				\
+over-around-source$(EXEEXT)				\
+over-below-source$(EXEEXT)				\
+over-between-source$(EXEEXT)				\
+paint$(EXEEXT)						\
+paint-repeat$(EXEEXT)					\
+paint-source-alpha$(EXEEXT)				\
+paint-with-alpha$(EXEEXT)				\
+pattern-get-type$(EXEEXT)				\
+pattern-getters$(EXEEXT)				\
+pixman-rotate$(EXEEXT)					\
+radial-gradient$(EXEEXT)				\
+random-intersections$(EXEEXT)				\
+rectangle-rounding-error$(EXEEXT)			\
+rectilinear-stroke$(EXEEXT)				\
+rgb24-ignore-alpha$(EXEEXT)				\
+rotate-image-surface-paint$(EXEEXT)			\
+scale-down-source-surface-paint$(EXEEXT)		\
+scale-source-surface-paint$(EXEEXT)			\
+select-font-face$(EXEEXT)				\
+select-font-no-show-text$(EXEEXT)			\
+self-copy$(EXEEXT)					\
+self-intersecting$(EXEEXT)				\
+set-source$(EXEEXT)					\
+show-text-current-point$(EXEEXT)			\
+skew-extreme$(EXEEXT)					\
+solid-pattern-cache-stress$(EXEEXT)			\
+source-clip$(EXEEXT)					\
+source-clip-scale$(EXEEXT)				\
+source-surface-scale-paint$(EXEEXT)			\
+surface-finish-twice$(EXEEXT)				\
+surface-pattern$(EXEEXT)				\
+surface-pattern-big-scale-down$(EXEEXT)			\
+surface-pattern-scale-down$(EXEEXT)			\
+surface-pattern-scale-up$(EXEEXT)			\
+text-antialias-gray$(EXEEXT)				\
+text-antialias-none$(EXEEXT)				\
+text-antialias-subpixel$(EXEEXT)			\
+text-cache-crash$(EXEEXT)				\
+text-pattern$(EXEEXT)					\
+text-rotate$(EXEEXT)					\
+text-zero-len$(EXEEXT)					\
+transforms$(EXEEXT)					\
+translate-show-surface$(EXEEXT)				\
+trap-clip$(EXEEXT)					\
+truetype-tables$(EXEEXT)				\
+unantialiased-shapes$(EXEEXT)				\
+unbounded-operator$(EXEEXT)				\
+user-data$(EXEEXT)					\
+rel-path$(EXEEXT)					\
+push-group$(EXEEXT)					\
+zero-alpha$(EXEEXT)
 
 # XXX: Here are some existing tests that are currently disabled for
 # one reason or another. They can still be built and run (manually)
@@ -166,49 +166,50 @@ zero-alpha
 #	suite, (in spite of the XFAIL status of the test). So maybe
 #	that's just a bug in the test rig that should just consider
 #	the abort an XFAIL like any other.
-DISABLED_TESTS =		\
-extend-reflect			\
-show-glyphs-many		\
-text-glyph-range
+DISABLED_TESTS =			\
+extend-reflect$(EXEEXT)			\
+show-glyphs-many$(EXEEXT)		\
+text-glyph-range$(EXEEXT)
 
 # Then we have a collection of tests that are only run if certain
 # features are compiled into cairo
 if HAVE_PTHREAD
-TESTS += pthread-show-text
+TESTS += pthread-show-text$(EXEEXT)
 endif
 
 if CAIRO_HAS_FT_FONT
-TESTS += bitmap-font
-TESTS += ft-font-create-for-ft-face
-TESTS += ft-text-vertical-layout-type1
-TESTS += ft-text-vertical-layout-type3
-TESTS += ft-text-antialias-none
+TESTS += bitmap-font$(EXEEXT)
+TESTS += ft-font-create-for-ft-face$(EXEEXT)
+TESTS += ft-text-vertical-layout-type1$(EXEEXT)
+TESTS += ft-text-vertical-layout-type3$(EXEEXT)
+TESTS += ft-text-antialias-none$(EXEEXT)
 endif
 
 if CAIRO_HAS_SVG_SURFACE
-TESTS += svg-surface svg-clip
+TESTS += svg-surface$(EXEEXT)
+TESTS += svg-clip$(EXEEXT)
 endif
 
 if CAIRO_HAS_PDF_SURFACE
-TESTS += pdf-features
+TESTS += pdf-features$(EXEEXT)
 endif
 
 if CAIRO_HAS_PS_SURFACE
-TESTS += ps-features
+TESTS += ps-features$(EXEEXT)
 endif
 
 if CAIRO_HAS_XLIB_SURFACE
-TESTS += xlib-surface
+TESTS += xlib-surface$(EXEEXT)
 endif
 
 if CAIRO_HAS_MULTI_PAGE_SURFACES
-TESTS += multi-page
+TESTS += multi-page$(EXEEXT)
 endif
 
 if CAIRO_HAS_SVG_SURFACE
 if CAIRO_HAS_PDF_SURFACE
 if CAIRO_HAS_PS_SURFACE
-TESTS += fallback-resolution
+TESTS += fallback-resolution$(EXEEXT)
 endif
 endif
 endif
@@ -505,17 +506,17 @@ $(REFERENCE_IMAGES)
 #
 # Also, any test listed here should call cairo_test_expect_failure and
 # provide an explanation for the expected failure.
-XFAIL_TESTS =			\
-a8-mask				\
-big-trap			\
-extend-pad			\
-filter-nearest-offset		\
-long-lines			\
-self-intersecting		\
-surface-pattern			\
-surface-pattern-big-scale-down  \
-surface-pattern-scale-down	\
-surface-pattern-scale-up
+XFAIL_TESTS =					\
+a8-mask$(EXEEXT)				\
+big-trap$(EXEEXT)				\
+extend-pad$(EXEEXT)				\
+filter-nearest-offset$(EXEEXT)			\
+long-lines$(EXEEXT)				\
+self-intersecting$(EXEEXT)			\
+surface-pattern$(EXEEXT)			\
+surface-pattern-big-scale-down$(EXEEXT)		\
+surface-pattern-scale-down$(EXEEXT)		\
+surface-pattern-scale-up$(EXEEXT)
 
 # Any test that doesn't generate a log file goes here
 NOLOG_TESTS =			\
@@ -597,7 +598,7 @@ EXTRA_PROGRAMS += $(TESTS) $(DISABLED_TESTS)
 TARGETS = $(CAIRO_TEST_TARGET)
 TARGETS_EXCLUDE = $(CAIRO_TEST_TARGET_EXCLUDE)
 
-TESTS_ENVIRONMENT = CAIRO_XFAIL_TESTS="$(XFAIL_TESTS)" CAIRO_TEST_TARGET="$(TARGETS)" CAIRO_TEST_TARGET_EXCLUDE="$(TARGETS_EXCLUDE)"
+TESTS_ENVIRONMENT = CAIRO_XFAIL_TESTS="$(XFAIL_TESTS:$(EXEEXT)=)" CAIRO_TEST_TARGET="$(TARGETS)" CAIRO_TEST_TARGET_EXCLUDE="$(TARGETS_EXCLUDE)"
 
 EXTRA_VALGRIND_FLAGS = $(CAIRO_EXTRA_VALGRIND_FLAGS)
 VALGRIND_FLAGS = \
@@ -629,8 +630,8 @@ check-valgrind:
 	$(MAKE) $(AM_MAKEFLAGS) check TESTS_ENVIRONMENT='$(TESTS_ENVIRONMENT) $(top_builddir)/libtool --mode=execute valgrind $(VALGRIND_FLAGS)' 2>&1 | tee valgrind-log
 
 # The following definitions both should work.
-#FAILED_TESTS = `grep -l '\<FAIL\>' $(TESTS:=.log) 2>/dev/null | sed -e 's/[.]log$$//' | xargs echo`
-FAILED_TESTS = `grep -l '\<FAIL\>' $(TESTS:=.log) 2>/dev/null | tr '\n' ' ' | sed -e 's/[.]log  */ /g; s/^ //; s/ $$//'`
+#FAILED_TESTS = `grep -l '\<FAIL\>' $(TESTS:$(EXEEXT)=.log) 2>/dev/null | sed -e 's/[.]log$$//' | xargs echo`
+FAILED_TESTS = `grep -l '\<FAIL\>' $(TESTS:$(EXEEXT)=.log) 2>/dev/null | tr '\n' ' ' | sed -e 's/[.]log  */ /g; s/^ //; s/ $$//'`
 
 recheck = check TESTS="$(FAILED_TESTS)"
 
@@ -655,7 +656,7 @@ retest:
 # Make index.html with no dependency tracking.
 html:
 	@echo Creating index.html
-	@perl $(srcdir)/make-html.pl $(TESTS:=.log) > index.html
+	@perl $(srcdir)/make-html.pl $(TESTS:$(EXEEXT)=.log) > index.html
 
 # Make index.html with no dependency tracking, containing only the failed tests.
 rehtml:
@@ -669,7 +670,7 @@ NOLOG_TESTS_LOG = $(NOLOG_TESTS:=.log)
 $(NOLOG_TESTS_LOG):
 	echo dummy > $@
 
-index.html: $(srcdir)/make-html.pl $(TESTS:=.log)
+index.html: $(srcdir)/make-html.pl $(TESTS:$(EXEEXT)=.log)
 	@echo Creating index.html
 	@perl $^ > $@
 
commit 9ae4b219e1c5b7a8c139b004a97d86a1ce1d408c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 14:47:16 2008 +0000

    [test/solid-pattern-cache-stress] Check for drand48().
    
    Apply an alternative rand() function if drand48() is not available for
    the platform.

diff --git a/configure.in b/configure.in
index b0c5929..8da5902 100644
--- a/configure.in
+++ b/configure.in
@@ -87,7 +87,7 @@ AC_DEFUN([_CHECK_FUNCS_WITH_FLAGS],
 
 dnl ===========================================================================
 
-AC_CHECK_FUNCS(vasnprintf ctime_r)
+AC_CHECK_FUNCS(vasnprintf ctime_r drand48)
 	
 dnl ===========================================================================
 dnl
diff --git a/test/solid-pattern-cache-stress.c b/test/solid-pattern-cache-stress.c
index 93e2f69..957b204 100644
--- a/test/solid-pattern-cache-stress.c
+++ b/test/solid-pattern-cache-stress.c
@@ -1,12 +1,12 @@
 /*
- * Copyright ? 2007 Chris Wilson.
+ * Copyright © 2007 Chris Wilson.
  *
  * Permission to use, copy, modify, distribute, and sell this software
  * and its documentation for any purpose is hereby granted without
  * fee, provided that the above copyright notice appear in all copies
  * and that both that copyright notice and this permission notice
  * appear in supporting documentation, and that the name of
- * Chris Wilson. not be used in advertising or publicity pertaining to
+ * Chris Wilson. Not be used in advertising or publicity pertaining to
  * distribution of the software without specific, written prior
  * permission. Chris Wilson makes no representations about the
  * suitability of this software for any purpose.  It is provided "as
@@ -23,6 +23,10 @@
  * Author: Chris Wilson <chris at chris-wilson.co.uk>
  */
 
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "cairo-test.h"
 
 static cairo_test_draw_function_t draw;
@@ -39,6 +43,10 @@ cairo_test_t test = {
 #define LOOPS 10
 #define NRAND 100
 
+#ifndef HAVE_DRAND48
+#define drand48() (rand () / (double) RAND_MAX)
+#endif
+
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
commit 648289c639618cc31394f889f6e329ddcaca41ee
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 14:36:57 2008 +0000

    [configure.in] Add paranoid double checking for (svg|pdf)2png
    
    Due to my incomplete cross-build environment, configure detects the
    presence of rsvg and poppler, but they cannot be used. To make my life
    easier, add a check similar to that used for fontconfig to ensure the
    libraries are usable before compiling the optional test utilites.

diff --git a/configure.in b/configure.in
index c70b043..b0c5929 100644
--- a/configure.in
+++ b/configure.in
@@ -609,9 +609,10 @@ test_pdf=no
 if test "x$use_pdf" = "xyes"; then
   poppler_DEPENDENCY="poppler-glib >= $POPPLER_VERSION_REQUIRED"
   PKG_CHECK_MODULES(POPPLER, $poppler_DEPENDENCY pango gtk+-2.0,
+		    [_CHECK_FUNCS_WITH_FLAGS(poppler_page_render_to_pixbuf, [$POPPLER_CFLAGS], [$POPPLER_LIBS],
                     [test_pdf=yes],
 		    [AC_MSG_RESULT(no)
-		     test_pdf="no (requires $poppler_DEPENDENCY)"])
+		     test_pdf="no (requires $poppler_DEPENDENCY)"])])
   if test "x$test_pdf" = "xyes"; then
     AC_DEFINE([CAIRO_CAN_TEST_PDF_SURFACE], 1, [Define to 1 if the PDF backend can be tested (need poppler and other dependencies for pdf2png)])
   else
@@ -638,9 +639,10 @@ test_svg=no
 if test "x$use_svg" = "xyes"; then
   librsvg_DEPENDENCY="librsvg-2.0 >= $LIBRSVG_VERSION_REQUIRED"
   PKG_CHECK_MODULES(LIBRSVG, $librsvg_DEPENDENCY gdk-2.0,
+		    [_CHECK_FUNCS_WITH_FLAGS(rsvg_pixbuf_from_file, [$LIBRSVG_CFLAGS], [$LIBRSVG_LIBS],
                     [test_svg=yes],
 		    [AC_MSG_RESULT(no)
-		     test_svg="no (requires $librsvg_DEPENDENCY)"])
+		     test_svg="no (requires $librsvg_DEPENDENCY)"])])
   if test "x$test_svg" = "xyes"; then
     AC_DEFINE([CAIRO_CAN_TEST_SVG_SURFACE], 1, [Define to 1 if the SVG backend can be tested])
   else
commit 909c57ce158e41bf2761f82b2678dc1f390051d2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 12:45:58 2008 +0000

    [cairo-pdf-operators] Be consistent in error checks.
    
    Consistently check the output status at the end of each function -
    helps with early error detection and even improves test code coverage!

diff --git a/src/cairo-pdf-operators.c b/src/cairo-pdf-operators.c
index 3c06e72..a049d44 100644
--- a/src/cairo-pdf-operators.c
+++ b/src/cairo-pdf-operators.c
@@ -46,9 +46,9 @@
 #include "cairo-scaled-font-subsets-private.h"
 
 void
-_cairo_pdf_operators_init (cairo_pdf_operators_t 	*pdf_operators,
-			   cairo_output_stream_t   	*stream,
-			   cairo_matrix_t 		 cairo_to_pdf,
+_cairo_pdf_operators_init (cairo_pdf_operators_t	*pdf_operators,
+			   cairo_output_stream_t	*stream,
+			   cairo_matrix_t		 cairo_to_pdf,
 			   cairo_scaled_font_subsets_t  *font_subsets)
 {
     pdf_operators->stream = stream;
@@ -59,12 +59,12 @@ _cairo_pdf_operators_init (cairo_pdf_operators_t 	*pdf_operators,
 }
 
 void
-_cairo_pdf_operators_fini (cairo_pdf_operators_t 	*pdf_operators)
+_cairo_pdf_operators_fini (cairo_pdf_operators_t	*pdf_operators)
 {
 }
 
 void
-_cairo_pdf_operators_set_font_subsets_callback (cairo_pdf_operators_t 		     *pdf_operators,
+_cairo_pdf_operators_set_font_subsets_callback (cairo_pdf_operators_t		     *pdf_operators,
 						cairo_pdf_operators_use_font_subset_t use_font_subset,
 						void				     *closure)
 {
@@ -73,7 +73,7 @@ _cairo_pdf_operators_set_font_subsets_callback (cairo_pdf_operators_t 		     *pd
 }
 
 void
-_cairo_pdf_operators_set_stream (cairo_pdf_operators_t 	 *pdf_operators,
+_cairo_pdf_operators_set_stream (cairo_pdf_operators_t	 *pdf_operators,
 				 cairo_output_stream_t   *stream)
 {
     pdf_operators->stream = stream;
@@ -81,7 +81,7 @@ _cairo_pdf_operators_set_stream (cairo_pdf_operators_t 	 *pdf_operators,
 
 void
 _cairo_pdf_operators_set_cairo_to_pdf_matrix (cairo_pdf_operators_t *pdf_operators,
-					      cairo_matrix_t 	     cairo_to_pdf)
+					      cairo_matrix_t	     cairo_to_pdf)
 {
     pdf_operators->cairo_to_pdf = cairo_to_pdf;
 }
@@ -107,7 +107,7 @@ _cairo_pdf_path_move_to (void *closure, cairo_point_t *point)
     _cairo_output_stream_printf (info->output,
 				 "%f %f m ", x, y);
 
-    return CAIRO_STATUS_SUCCESS;
+    return _cairo_output_stream_get_status (info->output);
 }
 
 static cairo_status_t
@@ -124,7 +124,8 @@ _cairo_pdf_path_line_to (void *closure, cairo_point_t *point)
 
     _cairo_output_stream_printf (info->output,
 				 "%f %f l ", x, y);
-    return CAIRO_STATUS_SUCCESS;
+
+    return _cairo_output_stream_get_status (info->output);
 }
 
 static cairo_status_t
@@ -155,7 +156,7 @@ _cairo_pdf_path_curve_to (void          *closure,
     _cairo_output_stream_printf (info->output,
 				 "%f %f %f %f %f %f c ",
 				 bx, by, cx, cy, dx, dy);
-    return CAIRO_STATUS_SUCCESS;
+    return _cairo_output_stream_get_status (info->output);
 }
 
 static cairo_status_t
@@ -166,11 +167,11 @@ _cairo_pdf_path_close_path (void *closure)
     _cairo_output_stream_printf (info->output,
 				 "h\r\n");
 
-    return CAIRO_STATUS_SUCCESS;
+    return _cairo_output_stream_get_status (info->output);
 }
 
 cairo_int_status_t
-_cairo_pdf_operators_clip (cairo_pdf_operators_t 	*pdf_operators,
+_cairo_pdf_operators_clip (cairo_pdf_operators_t	*pdf_operators,
 			   cairo_path_fixed_t		*path,
 			   cairo_fill_rule_t		 fill_rule)
 {
@@ -213,7 +214,7 @@ _cairo_pdf_operators_clip (cairo_pdf_operators_t 	*pdf_operators,
 				 "%s n\r\n",
 				 pdf_operator);
 
-    return CAIRO_STATUS_SUCCESS;
+    return _cairo_output_stream_get_status (pdf_operators->stream);
 }
 
 static int
@@ -249,7 +250,7 @@ _cairo_pdf_line_join (cairo_line_join_t join)
 }
 
 static cairo_int_status_t
-_cairo_pdf_operators_emit_stroke_style (cairo_pdf_operators_t 	*pdf_operators,
+_cairo_pdf_operators_emit_stroke_style (cairo_pdf_operators_t	*pdf_operators,
 					cairo_stroke_style_t	*style)
 {
     _cairo_output_stream_printf (pdf_operators->stream,
@@ -284,7 +285,7 @@ _cairo_pdf_operators_emit_stroke_style (cairo_pdf_operators_t 	*pdf_operators,
 
 
 cairo_int_status_t
-_cairo_pdf_operator_stroke (cairo_pdf_operators_t 	*pdf_operators,
+_cairo_pdf_operator_stroke (cairo_pdf_operators_t	*pdf_operators,
 			    cairo_path_fixed_t		*path,
 			    cairo_stroke_style_t	*style,
 			    cairo_matrix_t		*ctm,
@@ -324,9 +325,9 @@ _cairo_pdf_operator_stroke (cairo_pdf_operators_t 	*pdf_operators,
 }
 
 cairo_int_status_t
-_cairo_pdf_operators_fill (cairo_pdf_operators_t 	*pdf_operators,
+_cairo_pdf_operators_fill (cairo_pdf_operators_t	*pdf_operators,
 			   cairo_path_fixed_t		*path,
-			   cairo_fill_rule_t	 	fill_rule)
+			   cairo_fill_rule_t		fill_rule)
 {
     const char *pdf_operator;
     cairo_status_t status;
@@ -366,9 +367,9 @@ _cairo_pdf_operators_fill (cairo_pdf_operators_t 	*pdf_operators,
 #define GLYPH_POSITION_TOLERANCE 0.001
 
 cairo_int_status_t
-_cairo_pdf_operators_show_glyphs (cairo_pdf_operators_t 	*pdf_operators,
+_cairo_pdf_operators_show_glyphs (cairo_pdf_operators_t		*pdf_operators,
 				  cairo_glyph_t			*glyphs,
-				  int			 	 num_glyphs,
+				  int				 num_glyphs,
 				  cairo_scaled_font_t		*scaled_font)
 {
     unsigned int current_subset_id = (unsigned int)-1;
commit 4ffb0a80b3aa9e54804082a24c58db0d2527073d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 12:51:07 2008 +0000

    [cairo-paginated-surface] Call the abstract cairo_surface_show_page ().
    
    Use the generic surface layer cairo_surface_show_page() instead of
    directly calling cairo_paginated_surface_show_page(), as the higher
    level performs more error checking.

diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index d644d87..eb9699a 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -161,7 +161,7 @@ _cairo_paginated_surface_finish (void *abstract_surface)
     cairo_status_t status = CAIRO_STATUS_SUCCESS;
 
     if (surface->page_is_blank == FALSE || surface->page_num == 1)
-	status = _cairo_paginated_surface_show_page (abstract_surface);
+	status = cairo_surface_show_page (abstract_surface);
 
     if (status == CAIRO_STATUS_SUCCESS) {
 	cairo_surface_finish (surface->target);
commit 9d49c4b10e636c0868d15c50cb1d2a724000fc07
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 14:18:25 2008 +0000

    [configure] Print version info in summary.
    
    Add the cairo version to the configure summary.

diff --git a/configure.in b/configure.in
index 37e5e9f..c70b043 100644
--- a/configure.in
+++ b/configure.in
@@ -995,8 +995,9 @@ AC_OUTPUT
 
 dnl ===========================================================================
 
+V="$CAIRO_VERSION_MAJOR.$CAIRO_VERSION_MINOR.$CAIRO_VERSION_MICRO"
 echo ""
-echo "cairo will be compiled with the following surface backends:"
+echo "cairo (version $V) will be compiled with the following surface backends:"
 echo "  image:         yes (always builtin)"
 echo "  Xlib:          $use_xlib"
 echo "  Xlib Xrender:  $use_xlib_xrender"
commit ea4dec08f7c62ad3c3e81aa06ce0dd5a08936c45
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 13:50:42 2008 +0000

    [configure.in] Fixup fontconfig check.
    
    Correct the check for FcFini() so that the result is actually used.

diff --git a/configure.in b/configure.in
index 7de0f4d..37e5e9f 100644
--- a/configure.in
+++ b/configure.in
@@ -498,8 +498,8 @@ FREETYPE_MIN_VERSION=9.7.3
 CAIRO_BACKEND_ENABLE(ft, FreeType font, freetype, FT_FONT, auto, [
   ft_REQUIRES="fontconfig"
   PKG_CHECK_MODULES(FONTCONFIG, $ft_REQUIRES,
-		    [_CHECK_FUNCS_WITH_FLAGS(FcFini, [$FONTCONFIG_CFLAGS], [$FONTCONFIG_LIBS])],
-		    [AC_MSG_RESULT(no); use_ft="no (requires fontconfig)"])
+		    [_CHECK_FUNCS_WITH_FLAGS(FcFini, [$FONTCONFIG_CFLAGS], [$FONTCONFIG_LIBS],,
+		    [AC_MSG_RESULT(no); use_ft="no (requires fontconfig)"])])
 
   if test "x$use_ft" = "xyes"; then
     PKG_CHECK_MODULES(FREETYPE, freetype2 >= $FREETYPE_MIN_VERSION,
commit f4e7e7d6b4bb8e96dc8aef1ac673b8d64f65634c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 13:08:23 2008 +0000

    [cairo-path-bounds] _cairo_path_fixed_bounds() should never fail.
    
    _cairo_path_fixed_bounds() should never fail so change return type
    to void and update caller.

diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c
index 29b74f3..357e79a 100644
--- a/src/cairo-analysis-surface.c
+++ b/src/cairo-analysis-surface.c
@@ -221,28 +221,24 @@ _cairo_analysis_surface_intersect_clip_path (void		*abstract_surface,
     cairo_analysis_surface_t *surface = abstract_surface;
     double                    x1, y1, x2, y2;
     cairo_rectangle_int_t   extent;
-    cairo_status_t	      status;
 
     if (path == NULL) {
 	surface->current_clip.x = 0;
 	surface->current_clip.y = 0;
-	surface->current_clip.width = surface->width;
+	surface->current_clip.width  = surface->width;
 	surface->current_clip.height = surface->height;
-	status = CAIRO_STATUS_SUCCESS;
     } else {
-	status = _cairo_path_fixed_bounds (path, &x1, &y1, &x2, &y2);
-	if (status)
-	    return status;
+	_cairo_path_fixed_bounds (path, &x1, &y1, &x2, &y2);
 
 	extent.x = floor (x1);
 	extent.y = floor (y1);
-	extent.width = ceil (x2) - extent.x;
+	extent.width  = ceil (x2) - extent.x;
 	extent.height = ceil (y2) - extent.y;
 
 	_cairo_rectangle_intersect (&surface->current_clip, &extent);
     }
 
-    return status;
+    return CAIRO_STATUS_SUCCESS;
 }
 
 static cairo_int_status_t
diff --git a/src/cairo-path-bounds.c b/src/cairo-path-bounds.c
index 49b4ab9..55a64e5 100644
--- a/src/cairo-path-bounds.c
+++ b/src/cairo-path-bounds.c
@@ -148,7 +148,7 @@ _cairo_path_bounder_close_path (void *closure)
 }
 
 /* XXX: Perhaps this should compute a PixRegion rather than 4 doubles */
-cairo_status_t
+void
 _cairo_path_fixed_bounds (cairo_path_fixed_t *path,
 			  double *x1, double *y1,
 			  double *x2, double *y2)
@@ -165,7 +165,9 @@ _cairo_path_fixed_bounds (cairo_path_fixed_t *path,
 					  _cairo_path_bounder_curve_to,
 					  _cairo_path_bounder_close_path,
 					  &bounder);
-    if (status || ! bounder.has_point) {
+    assert (status == CAIRO_STATUS_SUCCESS);
+
+    if (! bounder.has_point) {
 	*x1 = *y1 = *x2 = *y2 = 0.;
     } else {
 	*x1 = _cairo_fixed_to_double (bounder.min_x);
@@ -175,6 +177,4 @@ _cairo_path_fixed_bounds (cairo_path_fixed_t *path,
     }
 
     _cairo_path_bounder_fini (&bounder);
-
-    return status;
 }
commit 5fad969317186520ebbe09f3767907fb3bfd6164
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jan 7 10:03:51 2008 +0000

    [cairo-ft-font] Destroy unscaled font ref on error.
    
    Destroy the local reference taken to the unscaled font if we encounter
    an error whilst creating the derived scaled font.

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 65aa0fc..0db38ae 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -1495,6 +1495,7 @@ _cairo_ft_scaled_font_create (cairo_ft_unscaled_font_t	 *unscaled,
 				      font_matrix, ctm, options,
 				      &cairo_ft_scaled_font_backend);
     if (status) {
+	_cairo_unscaled_font_destroy (&unscaled->base);
 	free (scaled_font);
 	goto FAIL;
     }
@@ -1502,6 +1503,7 @@ _cairo_ft_scaled_font_create (cairo_ft_unscaled_font_t	 *unscaled,
     status = _cairo_ft_unscaled_font_set_scale (unscaled,
 				                &scaled_font->base.scale);
     if (status) {
+	_cairo_unscaled_font_destroy (&unscaled->base);
 	free (scaled_font);
 	goto FAIL;
     }
commit 3b1411167c7d9fd94536c69de54dacfaf820e916
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jan 10 12:55:08 2008 +0000

    [headers] Brute force fixup of including cairoint.h from boilerplate.
    
    More the majority of the typedefs from cairoint.h to
    cairo-types-private.h and fixup cairo-pdf-operators-private.h to
    avoid including cairoint.h.
    
    A better approach would seem to be to rationalise cairoint.h so that it
    only provides the symbol aliasing, moving the types and functions to
    more appropriate private headers. However, this fixes the immediate
    problem of running make check!

diff --git a/src/cairo-pdf-operators-private.h b/src/cairo-pdf-operators-private.h
index 835d395..83ef73c 100644
--- a/src/cairo-pdf-operators-private.h
+++ b/src/cairo-pdf-operators-private.h
@@ -42,7 +42,8 @@
 #ifndef CAIRO_PDF_OPERATORS_H
 #define CAIRO_PDF_OPERATORS_H
 
-#include "cairoint.h"
+#include "cairo-compiler-private.h"
+#include "cairo-types-private.h"
 
 typedef cairo_status_t
 (*cairo_pdf_operators_use_font_subset_t) (unsigned int  font_id,
diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h
index 3954f13..8580beb 100644
--- a/src/cairo-types-private.h
+++ b/src/cairo-types-private.h
@@ -41,6 +41,7 @@
 /* This is the only header file not including cairoint.h.  It only contains
  * typedefs.*/
 #include "cairo.h"
+#include "cairo-fixed-private.h"
 
 typedef struct _cairo_array cairo_array_t;
 typedef struct _cairo_hash_table cairo_hash_table_t;
@@ -149,4 +150,172 @@ typedef enum _cairo_internal_surface_type {
     CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED
 } cairo_internal_surface_type_t;
 
+typedef struct _cairo_region cairo_region_t;
+
+typedef struct _cairo_point {
+    cairo_fixed_t x;
+    cairo_fixed_t y;
+} cairo_point_t;
+
+typedef struct _cairo_slope
+{
+    cairo_fixed_t dx;
+    cairo_fixed_t dy;
+} cairo_slope_t, cairo_distance_t;
+
+typedef struct _cairo_point_double {
+    double x;
+    double y;
+} cairo_point_double_t;
+
+typedef struct _cairo_distance_double {
+    double dx;
+    double dy;
+} cairo_distance_double_t;
+
+typedef struct _cairo_line {
+    cairo_point_t p1;
+    cairo_point_t p2;
+} cairo_line_t, cairo_box_t;
+
+typedef struct _cairo_trapezoid {
+    cairo_fixed_t top, bottom;
+    cairo_line_t left, right;
+} cairo_trapezoid_t;
+
+typedef struct _cairo_rectangle_int16 {
+    int16_t x, y;
+    uint16_t width, height;
+} cairo_rectangle_int16_t, cairo_glyph_size_t;
+
+typedef struct _cairo_rectangle_int32 {
+    int32_t x, y;
+    uint32_t width, height;
+} cairo_rectangle_int32_t;
+
+typedef struct _cairo_point_int16 {
+    int16_t x, y;
+} cairo_point_int16_t;
+
+typedef struct _cairo_point_int32 {
+    int16_t x, y;
+} cairo_point_int32_t;
+
+typedef struct _cairo_box_int16 {
+    cairo_point_int16_t p1;
+    cairo_point_int16_t p2;
+} cairo_box_int16_t;
+
+typedef struct _cairo_box_int32 {
+    cairo_point_int32_t p1;
+    cairo_point_int32_t p2;
+} cairo_box_int32_t;
+
+
+#if CAIRO_FIXED_BITS == 32 && CAIRO_FIXED_FRAC_BITS >= 16
+typedef cairo_rectangle_int16_t cairo_rectangle_int_t;
+typedef cairo_point_int16_t cairo_point_int_t;
+typedef cairo_box_int16_t cairo_box_int_t;
+#define CAIRO_RECT_INT_MIN INT16_MIN
+#define CAIRO_RECT_INT_MAX INT16_MAX
+#elif CAIRO_FIXED_BITS == 32
+typedef cairo_rectangle_int32_t cairo_rectangle_int_t;
+typedef cairo_point_int32_t cairo_point_int_t;
+typedef cairo_box_int32_t cairo_box_int_t;
+#define CAIRO_RECT_INT_MIN INT32_MIN
+#define CAIRO_RECT_INT_MAX INT32_MAX
+#else
+#error Not sure how to pick a cairo_rectangle_int_t for your CAIRO_FIXED_BITS!
+#endif
+
+typedef enum _cairo_direction {
+    CAIRO_DIRECTION_FORWARD,
+    CAIRO_DIRECTION_REVERSE
+} cairo_direction_t;
+
+typedef struct _cairo_path_fixed cairo_path_fixed_t;
+typedef enum _cairo_clip_mode {
+    CAIRO_CLIP_MODE_PATH,
+    CAIRO_CLIP_MODE_REGION,
+    CAIRO_CLIP_MODE_MASK
+} cairo_clip_mode_t;
+typedef struct _cairo_clip_path cairo_clip_path_t;
+
+typedef struct _cairo_edge {
+    cairo_line_t edge;
+    int clockWise;
+
+    cairo_fixed_t current_x;
+} cairo_edge_t;
+
+typedef struct _cairo_polygon {
+    cairo_status_t status;
+
+    cairo_point_t first_point;
+    cairo_point_t current_point;
+    cairo_bool_t has_current_point;
+
+    int num_edges;
+    int edges_size;
+    cairo_edge_t *edges;
+    cairo_edge_t  edges_embedded[8];
+} cairo_polygon_t;
+
+typedef struct _cairo_spline_knots {
+    cairo_point_t a, b, c, d;
+} cairo_spline_knots_t;
+typedef struct _cairo_spline {
+    cairo_spline_knots_t knots;
+
+    cairo_slope_t initial_slope;
+    cairo_slope_t final_slope;
+
+    int num_points;
+    int points_size;
+    cairo_point_t *points;
+    cairo_point_t  points_embedded[8];
+} cairo_spline_t;
+
+typedef struct _cairo_pen_vertex {
+    cairo_point_t point;
+
+    cairo_slope_t slope_ccw;
+    cairo_slope_t slope_cw;
+} cairo_pen_vertex_t;
+
+typedef struct _cairo_pen {
+    double radius;
+    double tolerance;
+
+    cairo_pen_vertex_t *vertices;
+    int num_vertices;
+} cairo_pen_t;
+
+typedef struct _cairo_color cairo_color_t;
+typedef struct _cairo_image_surface cairo_image_surface_t;
+
+typedef struct _cairo_stroke_style {
+    double		 line_width;
+    cairo_line_cap_t	 line_cap;
+    cairo_line_join_t	 line_join;
+    double		 miter_limit;
+    double		*dash;
+    unsigned int	 num_dashes;
+    double		 dash_offset;
+} cairo_stroke_style_t;
+
+typedef struct _cairo_format_masks {
+    int bpp;
+    unsigned long alpha_mask;
+    unsigned long red_mask;
+    unsigned long green_mask;
+    unsigned long blue_mask;
+} cairo_format_masks_t;
+
+typedef enum {
+    CAIRO_STOCK_WHITE,
+    CAIRO_STOCK_BLACK,
+    CAIRO_STOCK_TRANSPARENT
+} cairo_stock_t;
+
 #endif /* CAIRO_TYPES_PRIVATE_H */
diff --git a/src/cairoint.h b/src/cairoint.h
index 19513a7..ce74db0 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -178,152 +178,8 @@ be32_to_cpu(uint32_t v)
 
 #include "cairo-types-private.h"
 #include "cairo-cache-private.h"
-#include "cairo-fixed-private.h"
 #include "cairo-reference-count-private.h"
 
-typedef struct _cairo_region cairo_region_t;
-
-typedef struct _cairo_point {
-    cairo_fixed_t x;
-    cairo_fixed_t y;
-} cairo_point_t;
-
-typedef struct _cairo_slope
-{
-    cairo_fixed_t dx;
-    cairo_fixed_t dy;
-} cairo_slope_t, cairo_distance_t;
-
-typedef struct _cairo_point_double {
-    double x;
-    double y;
-} cairo_point_double_t;
-
-typedef struct _cairo_distance_double {
-    double dx;
-    double dy;
-} cairo_distance_double_t;
-
-typedef struct _cairo_line {
-    cairo_point_t p1;
-    cairo_point_t p2;
-} cairo_line_t, cairo_box_t;
-
-typedef struct _cairo_trapezoid {
-    cairo_fixed_t top, bottom;
-    cairo_line_t left, right;
-} cairo_trapezoid_t;
-
-typedef struct _cairo_rectangle_int16 {
-    int16_t x, y;
-    uint16_t width, height;
-} cairo_rectangle_int16_t, cairo_glyph_size_t;
-
-typedef struct _cairo_rectangle_int32 {
-    int32_t x, y;
-    uint32_t width, height;
-} cairo_rectangle_int32_t;
-
-typedef struct _cairo_point_int16 {
-    int16_t x, y;
-} cairo_point_int16_t;
-
-typedef struct _cairo_point_int32 {
-    int16_t x, y;
-} cairo_point_int32_t;
-
-typedef struct _cairo_box_int16 {
-    cairo_point_int16_t p1;
-    cairo_point_int16_t p2;
-} cairo_box_int16_t;
-
-typedef struct _cairo_box_int32 {
-    cairo_point_int32_t p1;
-    cairo_point_int32_t p2;
-} cairo_box_int32_t;
-
-#if CAIRO_FIXED_BITS == 32 && CAIRO_FIXED_FRAC_BITS >= 16
-typedef cairo_rectangle_int16_t cairo_rectangle_int_t;
-typedef cairo_point_int16_t cairo_point_int_t;
-typedef cairo_box_int16_t cairo_box_int_t;
-#define CAIRO_RECT_INT_MIN INT16_MIN
-#define CAIRO_RECT_INT_MAX INT16_MAX
-#elif CAIRO_FIXED_BITS == 32
-typedef cairo_rectangle_int32_t cairo_rectangle_int_t;
-typedef cairo_point_int32_t cairo_point_int_t;
-typedef cairo_box_int32_t cairo_box_int_t;
-#define CAIRO_RECT_INT_MIN INT32_MIN
-#define CAIRO_RECT_INT_MAX INT32_MAX
-#else
-#error Not sure how to pick a cairo_rectangle_int_t for your CAIRO_FIXED_BITS!
-#endif
-
-typedef enum _cairo_direction {
-    CAIRO_DIRECTION_FORWARD,
-    CAIRO_DIRECTION_REVERSE
-} cairo_direction_t;
-
-typedef struct _cairo_path_fixed cairo_path_fixed_t;
-typedef enum _cairo_clip_mode {
-    CAIRO_CLIP_MODE_PATH,
-    CAIRO_CLIP_MODE_REGION,
-    CAIRO_CLIP_MODE_MASK
-} cairo_clip_mode_t;
-typedef struct _cairo_clip_path cairo_clip_path_t;
-
-typedef struct _cairo_edge {
-    cairo_line_t edge;
-    int clockWise;
-
-    cairo_fixed_t current_x;
-} cairo_edge_t;
-
-typedef struct _cairo_polygon {
-    cairo_status_t status;
-
-    cairo_point_t first_point;
-    cairo_point_t current_point;
-    cairo_bool_t has_current_point;
-
-    int num_edges;
-    int edges_size;
-    cairo_edge_t *edges;
-    cairo_edge_t  edges_embedded[8];
-} cairo_polygon_t;
-
-typedef struct _cairo_spline_knots {
-    cairo_point_t a, b, c, d;
-} cairo_spline_knots_t;
-typedef struct _cairo_spline {
-    cairo_spline_knots_t knots;
-
-    cairo_slope_t initial_slope;
-    cairo_slope_t final_slope;
-
-    int num_points;
-    int points_size;
-    cairo_point_t *points;
-    cairo_point_t  points_embedded[8];
-} cairo_spline_t;
-
-typedef struct _cairo_pen_vertex {
-    cairo_point_t point;
-
-    cairo_slope_t slope_ccw;
-    cairo_slope_t slope_cw;
-} cairo_pen_vertex_t;
-
-typedef struct _cairo_pen {
-    double radius;
-    double tolerance;
-
-    cairo_pen_vertex_t *vertices;
-    int num_vertices;
-} cairo_pen_t;
-
-typedef struct _cairo_color cairo_color_t;
-typedef struct _cairo_image_surface cairo_image_surface_t;
-
 cairo_private void
 _cairo_box_round_to_rectangle (cairo_box_t *box, cairo_rectangle_int_t *rectangle);
 
@@ -571,16 +427,6 @@ extern const cairo_private struct _cairo_scaled_font_backend cairo_atsui_scaled_
 
 #endif
 
-typedef struct _cairo_stroke_style {
-    double		 line_width;
-    cairo_line_cap_t	 line_cap;
-    cairo_line_join_t	 line_join;
-    double		 miter_limit;
-    double		*dash;
-    unsigned int	 num_dashes;
-    double		 dash_offset;
-} cairo_stroke_style_t;
-
 struct _cairo_surface_backend {
     cairo_surface_type_t type;
 
@@ -841,14 +687,6 @@ struct _cairo_surface_backend {
 				 cairo_antialias_t	 stroke_antialias);
 };
 
-typedef struct _cairo_format_masks {
-    int bpp;
-    unsigned long alpha_mask;
-    unsigned long red_mask;
-    unsigned long green_mask;
-    unsigned long blue_mask;
-} cairo_format_masks_t;
-
 #include "cairo-surface-private.h"
 
 struct _cairo_image_surface {
@@ -888,12 +726,6 @@ struct _cairo_color {
     unsigned short alpha_short;
 };
 
-typedef enum {
-    CAIRO_STOCK_WHITE,
-    CAIRO_STOCK_BLACK,
-    CAIRO_STOCK_TRANSPARENT
-} cairo_stock_t;
-
 #define CAIRO_EXTEND_SURFACE_DEFAULT CAIRO_EXTEND_NONE
 #define CAIRO_EXTEND_GRADIENT_DEFAULT CAIRO_EXTEND_PAD
 #define CAIRO_FILTER_DEFAULT CAIRO_FILTER_BEST
@@ -1521,7 +1353,7 @@ _cairo_path_fixed_interpret (cairo_path_fixed_t		  *path,
 		       cairo_path_fixed_close_path_func_t *close_path,
 		       void				  *closure);
 
-cairo_private cairo_status_t
+cairo_private void
 _cairo_path_fixed_bounds (cairo_path_fixed_t *path,
 			  double *x1, double *y1,
 			  double *x2, double *y2);


More information about the cairo-commit mailing list