[cairo-commit] 3 commits - src/cairo-compiler-private.h src/cairo-pattern.c src/check-doc-syntax.sh test/fallback-resolution.c test/fallback-resolution-ppi150-ref.png test/fallback-resolution-ppi150x150-ref.png test/fallback-resolution-ppi150x300-ref.png test/fallback-resolution-ppi150x37.5-ref.png test/fallback-resolution-ppi150x600-ref.png test/fallback-resolution-ppi150x72-ref.png test/fallback-resolution-ppi150x75-ref.png test/fallback-resolution-ppi300-ref.png test/fallback-resolution-ppi300x150-ref.png test/fallback-resolution-ppi300x300-ref.png test/fallback-resolution-ppi300x37.5-ref.png test/fallback-resolution-ppi300x600-ref.png test/fallback-resolution-ppi300x72-ref.png test/fallback-resolution-ppi300x75-ref.png test/fallback-resolution-ppi37.5-ref.png test/fallback-resolution-ppi37.5x150-ref.png test/fallback-resolution-ppi37.5x300-ref.png test/fallback-resolution-ppi37.5x37.5-ref.png test/fallback-resolution-ppi37.5x600-ref.png test/fallback-resolution-ppi37.5x72-ref.png test/fallback-resolution-ppi37.5x75-ref.png test/fallback-resolution-ppi600-ref.png test/fallback-resolution-ppi600x150-ref.png test/fallback-resolution-ppi600x300-ref.png test/fallback-resolution-ppi600x37.5-ref.png test/fallback-resolution-ppi600x600-ref.png test/fallback-resolution-ppi600x72-ref.png test/fallback-resolution-ppi600x75-ref.png test/fallback-resolution-ppi72-ref.png test/fallback-resolution-ppi72x150-ref.png test/fallback-resolution-ppi72x300-ref.png test/fallback-resolution-ppi72x37.5-ref.png test/fallback-resolution-ppi72x600-ref.png test/fallback-resolution-ppi72x72-ref.png test/fallback-resolution-ppi72x75-ref.png test/fallback-resolution-ppi75-ref.png test/fallback-resolution-ppi75x150-ref.png test/fallback-resolution-ppi75x300-ref.png test/fallback-resolution-ppi75x37.5-ref.png test/fallback-resolution-ppi75x600-ref.png test/fallback-resolution-ppi75x72-ref.png test/fallback-resolution-ppi75x75-ref.png test/Makefile.am

Chris Wilson ickle at kemper.freedesktop.org
Tue Oct 14 06:28:15 PDT 2008


 dev/null                                      |binary
 src/cairo-compiler-private.h                  |   22 +-
 src/cairo-pattern.c                           |   18 +-
 src/check-doc-syntax.sh                       |    6 
 test/Makefile.am                              |   42 ++++-
 test/fallback-resolution-ppi150x150-ref.png   |binary
 test/fallback-resolution-ppi150x300-ref.png   |binary
 test/fallback-resolution-ppi150x37.5-ref.png  |binary
 test/fallback-resolution-ppi150x600-ref.png   |binary
 test/fallback-resolution-ppi150x72-ref.png    |binary
 test/fallback-resolution-ppi150x75-ref.png    |binary
 test/fallback-resolution-ppi300x150-ref.png   |binary
 test/fallback-resolution-ppi300x300-ref.png   |binary
 test/fallback-resolution-ppi300x37.5-ref.png  |binary
 test/fallback-resolution-ppi300x600-ref.png   |binary
 test/fallback-resolution-ppi300x72-ref.png    |binary
 test/fallback-resolution-ppi300x75-ref.png    |binary
 test/fallback-resolution-ppi37.5x150-ref.png  |binary
 test/fallback-resolution-ppi37.5x300-ref.png  |binary
 test/fallback-resolution-ppi37.5x37.5-ref.png |binary
 test/fallback-resolution-ppi37.5x600-ref.png  |binary
 test/fallback-resolution-ppi37.5x72-ref.png   |binary
 test/fallback-resolution-ppi37.5x75-ref.png   |binary
 test/fallback-resolution-ppi600x150-ref.png   |binary
 test/fallback-resolution-ppi600x300-ref.png   |binary
 test/fallback-resolution-ppi600x37.5-ref.png  |binary
 test/fallback-resolution-ppi600x600-ref.png   |binary
 test/fallback-resolution-ppi600x72-ref.png    |binary
 test/fallback-resolution-ppi600x75-ref.png    |binary
 test/fallback-resolution-ppi72x150-ref.png    |binary
 test/fallback-resolution-ppi72x300-ref.png    |binary
 test/fallback-resolution-ppi72x37.5-ref.png   |binary
 test/fallback-resolution-ppi72x600-ref.png    |binary
 test/fallback-resolution-ppi72x72-ref.png     |binary
 test/fallback-resolution-ppi72x75-ref.png     |binary
 test/fallback-resolution-ppi75x150-ref.png    |binary
 test/fallback-resolution-ppi75x300-ref.png    |binary
 test/fallback-resolution-ppi75x37.5-ref.png   |binary
 test/fallback-resolution-ppi75x600-ref.png    |binary
 test/fallback-resolution-ppi75x72-ref.png     |binary
 test/fallback-resolution-ppi75x75-ref.png     |binary
 test/fallback-resolution.c                    |  199 +++++++++++++-------------
 42 files changed, 163 insertions(+), 124 deletions(-)

New commits:
commit 595414bb787d570ac95fc91c58c370558e9d5a54
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Oct 14 14:24:49 2008 +0100

    [test/fallback-resolution] Extend to cover separate ppi x/y.
    
    Adrian Johnson proposed a hack that fixed the current test by simply
    scaling the dashed stroke by device_transform.xx. Obviously this exposes a
    deficiency in the test case. So add an outer loop to iterate over several
    common ppi for both x and y and in doing so reveal more ugly artifacts in
    the current fallback code.

diff --git a/test/Makefile.am b/test/Makefile.am
index e244b55..2a88d53 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -429,12 +429,42 @@ REFERENCE_IMAGES = \
 	extend-reflect-ps3-ref.png \
 	extend-repeat-ref.png	\
 	extend-repeat-similar-ref.png	\
-	fallback-resolution-ppi37.5-ref.png \
-	fallback-resolution-ppi72-ref.png \
-	fallback-resolution-ppi75-ref.png \
-	fallback-resolution-ppi150-ref.png \
-	fallback-resolution-ppi300-ref.png \
-	fallback-resolution-ppi600-ref.png \
+	fallback-resolution-ppi37.5x37.5-ref.png \
+	fallback-resolution-ppi37.5x72-ref.png \
+	fallback-resolution-ppi37.5x75-ref.png \
+	fallback-resolution-ppi37.5x150-ref.png \
+	fallback-resolution-ppi37.5x300-ref.png \
+	fallback-resolution-ppi37.5x600-ref.png \
+	fallback-resolution-ppi72x37.5-ref.png \
+	fallback-resolution-ppi72x72-ref.png \
+	fallback-resolution-ppi72x75-ref.png \
+	fallback-resolution-ppi72x150-ref.png \
+	fallback-resolution-ppi72x300-ref.png \
+	fallback-resolution-ppi72x600-ref.png \
+	fallback-resolution-ppi75x37.5-ref.png \
+	fallback-resolution-ppi75x72-ref.png \
+	fallback-resolution-ppi75x75-ref.png \
+	fallback-resolution-ppi75x150-ref.png \
+	fallback-resolution-ppi75x300-ref.png \
+	fallback-resolution-ppi75x600-ref.png \
+	fallback-resolution-ppi150x37.5-ref.png \
+	fallback-resolution-ppi150x72-ref.png \
+	fallback-resolution-ppi150x75-ref.png \
+	fallback-resolution-ppi150x150-ref.png \
+	fallback-resolution-ppi150x300-ref.png \
+	fallback-resolution-ppi150x600-ref.png \
+	fallback-resolution-ppi300x37.5-ref.png \
+	fallback-resolution-ppi300x72-ref.png \
+	fallback-resolution-ppi300x75-ref.png \
+	fallback-resolution-ppi300x150-ref.png \
+	fallback-resolution-ppi300x300-ref.png \
+	fallback-resolution-ppi300x600-ref.png \
+	fallback-resolution-ppi600x37.5-ref.png \
+	fallback-resolution-ppi600x72-ref.png \
+	fallback-resolution-ppi600x75-ref.png \
+	fallback-resolution-ppi600x150-ref.png \
+	fallback-resolution-ppi600x300-ref.png \
+	fallback-resolution-ppi600x600-ref.png \
 	fill-alpha-ref.png	\
 	fill-alpha-pattern-ref.png	\
 	fill-alpha-pattern-pdf-argb32-ref.png	\
diff --git a/test/fallback-resolution-ppi150-ref.png b/test/fallback-resolution-ppi150-ref.png
deleted file mode 100644
index 8a69481..0000000
Binary files a/test/fallback-resolution-ppi150-ref.png and /dev/null differ
diff --git a/test/fallback-resolution-ppi150x150-ref.png b/test/fallback-resolution-ppi150x150-ref.png
new file mode 100644
index 0000000..8a69481
Binary files /dev/null and b/test/fallback-resolution-ppi150x150-ref.png differ
diff --git a/test/fallback-resolution-ppi150x300-ref.png b/test/fallback-resolution-ppi150x300-ref.png
new file mode 100644
index 0000000..a23c62f
Binary files /dev/null and b/test/fallback-resolution-ppi150x300-ref.png differ
diff --git a/test/fallback-resolution-ppi150x37.5-ref.png b/test/fallback-resolution-ppi150x37.5-ref.png
new file mode 100644
index 0000000..640046e
Binary files /dev/null and b/test/fallback-resolution-ppi150x37.5-ref.png differ
diff --git a/test/fallback-resolution-ppi150x600-ref.png b/test/fallback-resolution-ppi150x600-ref.png
new file mode 100644
index 0000000..baae356
Binary files /dev/null and b/test/fallback-resolution-ppi150x600-ref.png differ
diff --git a/test/fallback-resolution-ppi150x72-ref.png b/test/fallback-resolution-ppi150x72-ref.png
new file mode 100644
index 0000000..beee81d
Binary files /dev/null and b/test/fallback-resolution-ppi150x72-ref.png differ
diff --git a/test/fallback-resolution-ppi150x75-ref.png b/test/fallback-resolution-ppi150x75-ref.png
new file mode 100644
index 0000000..9332819
Binary files /dev/null and b/test/fallback-resolution-ppi150x75-ref.png differ
diff --git a/test/fallback-resolution-ppi300-ref.png b/test/fallback-resolution-ppi300-ref.png
deleted file mode 100644
index 66ed3eb..0000000
Binary files a/test/fallback-resolution-ppi300-ref.png and /dev/null differ
diff --git a/test/fallback-resolution-ppi300x150-ref.png b/test/fallback-resolution-ppi300x150-ref.png
new file mode 100644
index 0000000..30c0e72
Binary files /dev/null and b/test/fallback-resolution-ppi300x150-ref.png differ
diff --git a/test/fallback-resolution-ppi300x300-ref.png b/test/fallback-resolution-ppi300x300-ref.png
new file mode 100644
index 0000000..66ed3eb
Binary files /dev/null and b/test/fallback-resolution-ppi300x300-ref.png differ
diff --git a/test/fallback-resolution-ppi300x37.5-ref.png b/test/fallback-resolution-ppi300x37.5-ref.png
new file mode 100644
index 0000000..42acb2d
Binary files /dev/null and b/test/fallback-resolution-ppi300x37.5-ref.png differ
diff --git a/test/fallback-resolution-ppi300x600-ref.png b/test/fallback-resolution-ppi300x600-ref.png
new file mode 100644
index 0000000..5be3793
Binary files /dev/null and b/test/fallback-resolution-ppi300x600-ref.png differ
diff --git a/test/fallback-resolution-ppi300x72-ref.png b/test/fallback-resolution-ppi300x72-ref.png
new file mode 100644
index 0000000..a96fb72
Binary files /dev/null and b/test/fallback-resolution-ppi300x72-ref.png differ
diff --git a/test/fallback-resolution-ppi300x75-ref.png b/test/fallback-resolution-ppi300x75-ref.png
new file mode 100644
index 0000000..9500328
Binary files /dev/null and b/test/fallback-resolution-ppi300x75-ref.png differ
diff --git a/test/fallback-resolution-ppi37.5-ref.png b/test/fallback-resolution-ppi37.5-ref.png
deleted file mode 100644
index fe87bc1..0000000
Binary files a/test/fallback-resolution-ppi37.5-ref.png and /dev/null differ
diff --git a/test/fallback-resolution-ppi37.5x150-ref.png b/test/fallback-resolution-ppi37.5x150-ref.png
new file mode 100644
index 0000000..1814346
Binary files /dev/null and b/test/fallback-resolution-ppi37.5x150-ref.png differ
diff --git a/test/fallback-resolution-ppi37.5x300-ref.png b/test/fallback-resolution-ppi37.5x300-ref.png
new file mode 100644
index 0000000..823ff01
Binary files /dev/null and b/test/fallback-resolution-ppi37.5x300-ref.png differ
diff --git a/test/fallback-resolution-ppi37.5x37.5-ref.png b/test/fallback-resolution-ppi37.5x37.5-ref.png
new file mode 100644
index 0000000..fe87bc1
Binary files /dev/null and b/test/fallback-resolution-ppi37.5x37.5-ref.png differ
diff --git a/test/fallback-resolution-ppi37.5x600-ref.png b/test/fallback-resolution-ppi37.5x600-ref.png
new file mode 100644
index 0000000..614f607
Binary files /dev/null and b/test/fallback-resolution-ppi37.5x600-ref.png differ
diff --git a/test/fallback-resolution-ppi37.5x72-ref.png b/test/fallback-resolution-ppi37.5x72-ref.png
new file mode 100644
index 0000000..5156dd6
Binary files /dev/null and b/test/fallback-resolution-ppi37.5x72-ref.png differ
diff --git a/test/fallback-resolution-ppi37.5x75-ref.png b/test/fallback-resolution-ppi37.5x75-ref.png
new file mode 100644
index 0000000..8d3b828
Binary files /dev/null and b/test/fallback-resolution-ppi37.5x75-ref.png differ
diff --git a/test/fallback-resolution-ppi600-ref.png b/test/fallback-resolution-ppi600-ref.png
deleted file mode 100644
index c5694a3..0000000
Binary files a/test/fallback-resolution-ppi600-ref.png and /dev/null differ
diff --git a/test/fallback-resolution-ppi600x150-ref.png b/test/fallback-resolution-ppi600x150-ref.png
new file mode 100644
index 0000000..0173c0c
Binary files /dev/null and b/test/fallback-resolution-ppi600x150-ref.png differ
diff --git a/test/fallback-resolution-ppi600x300-ref.png b/test/fallback-resolution-ppi600x300-ref.png
new file mode 100644
index 0000000..4b91a2e
Binary files /dev/null and b/test/fallback-resolution-ppi600x300-ref.png differ
diff --git a/test/fallback-resolution-ppi600x37.5-ref.png b/test/fallback-resolution-ppi600x37.5-ref.png
new file mode 100644
index 0000000..a65688f
Binary files /dev/null and b/test/fallback-resolution-ppi600x37.5-ref.png differ
diff --git a/test/fallback-resolution-ppi600x600-ref.png b/test/fallback-resolution-ppi600x600-ref.png
new file mode 100644
index 0000000..c5694a3
Binary files /dev/null and b/test/fallback-resolution-ppi600x600-ref.png differ
diff --git a/test/fallback-resolution-ppi600x72-ref.png b/test/fallback-resolution-ppi600x72-ref.png
new file mode 100644
index 0000000..e1faae5
Binary files /dev/null and b/test/fallback-resolution-ppi600x72-ref.png differ
diff --git a/test/fallback-resolution-ppi600x75-ref.png b/test/fallback-resolution-ppi600x75-ref.png
new file mode 100644
index 0000000..23065b1
Binary files /dev/null and b/test/fallback-resolution-ppi600x75-ref.png differ
diff --git a/test/fallback-resolution-ppi72-ref.png b/test/fallback-resolution-ppi72-ref.png
deleted file mode 100644
index b9b3803..0000000
Binary files a/test/fallback-resolution-ppi72-ref.png and /dev/null differ
diff --git a/test/fallback-resolution-ppi72x150-ref.png b/test/fallback-resolution-ppi72x150-ref.png
new file mode 100644
index 0000000..a866230
Binary files /dev/null and b/test/fallback-resolution-ppi72x150-ref.png differ
diff --git a/test/fallback-resolution-ppi72x300-ref.png b/test/fallback-resolution-ppi72x300-ref.png
new file mode 100644
index 0000000..119c1a2
Binary files /dev/null and b/test/fallback-resolution-ppi72x300-ref.png differ
diff --git a/test/fallback-resolution-ppi72x37.5-ref.png b/test/fallback-resolution-ppi72x37.5-ref.png
new file mode 100644
index 0000000..8260c10
Binary files /dev/null and b/test/fallback-resolution-ppi72x37.5-ref.png differ
diff --git a/test/fallback-resolution-ppi72x600-ref.png b/test/fallback-resolution-ppi72x600-ref.png
new file mode 100644
index 0000000..82f6ad2
Binary files /dev/null and b/test/fallback-resolution-ppi72x600-ref.png differ
diff --git a/test/fallback-resolution-ppi72x72-ref.png b/test/fallback-resolution-ppi72x72-ref.png
new file mode 100644
index 0000000..b9b3803
Binary files /dev/null and b/test/fallback-resolution-ppi72x72-ref.png differ
diff --git a/test/fallback-resolution-ppi72x75-ref.png b/test/fallback-resolution-ppi72x75-ref.png
new file mode 100644
index 0000000..2d6c598
Binary files /dev/null and b/test/fallback-resolution-ppi72x75-ref.png differ
diff --git a/test/fallback-resolution-ppi75-ref.png b/test/fallback-resolution-ppi75-ref.png
deleted file mode 100644
index 03aa6c2..0000000
Binary files a/test/fallback-resolution-ppi75-ref.png and /dev/null differ
diff --git a/test/fallback-resolution-ppi75x150-ref.png b/test/fallback-resolution-ppi75x150-ref.png
new file mode 100644
index 0000000..b23395d
Binary files /dev/null and b/test/fallback-resolution-ppi75x150-ref.png differ
diff --git a/test/fallback-resolution-ppi75x300-ref.png b/test/fallback-resolution-ppi75x300-ref.png
new file mode 100644
index 0000000..73971ca
Binary files /dev/null and b/test/fallback-resolution-ppi75x300-ref.png differ
diff --git a/test/fallback-resolution-ppi75x37.5-ref.png b/test/fallback-resolution-ppi75x37.5-ref.png
new file mode 100644
index 0000000..c4481ee
Binary files /dev/null and b/test/fallback-resolution-ppi75x37.5-ref.png differ
diff --git a/test/fallback-resolution-ppi75x600-ref.png b/test/fallback-resolution-ppi75x600-ref.png
new file mode 100644
index 0000000..01a3324
Binary files /dev/null and b/test/fallback-resolution-ppi75x600-ref.png differ
diff --git a/test/fallback-resolution-ppi75x72-ref.png b/test/fallback-resolution-ppi75x72-ref.png
new file mode 100644
index 0000000..323e0e4
Binary files /dev/null and b/test/fallback-resolution-ppi75x72-ref.png differ
diff --git a/test/fallback-resolution-ppi75x75-ref.png b/test/fallback-resolution-ppi75x75-ref.png
new file mode 100644
index 0000000..03aa6c2
Binary files /dev/null and b/test/fallback-resolution-ppi75x75-ref.png differ
diff --git a/test/fallback-resolution.c b/test/fallback-resolution.c
index 4e78577..8b5842e 100644
--- a/test/fallback-resolution.c
+++ b/test/fallback-resolution.c
@@ -252,14 +252,14 @@ check_result (cairo_test_context_t *ctx,
 
 #if GENERATE_REFERENCE
 static void
-generate_reference (double ppi, const char *filename)
+generate_reference (double ppi_x, double ppi_y, const char *filename)
 {
     cairo_surface_t *surface, *target;
     cairo_t *cr;
     cairo_status_t status;
 
     surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
-	                                  SIZE*ppi/72, SIZE*ppi/72);
+	                                  SIZE*ppi_x/72, SIZE*ppi_y/72);
     cr = cairo_create (surface);
     cairo_surface_destroy (surface);
 
@@ -272,7 +272,7 @@ generate_reference (double ppi, const char *filename)
 	cairo_paint (cr);
     } cairo_restore (cr);
 
-    cairo_scale (cr, ppi/72., ppi/72.);
+    cairo_scale (cr, ppi_x/72., ppi_y/72.);
     draw (cr, SIZE, SIZE);
 
     surface = cairo_surface_reference (cairo_get_target (cr));
@@ -280,7 +280,7 @@ generate_reference (double ppi, const char *filename)
 
     target = cairo_image_surface_create (CAIRO_FORMAT_RGB24, SIZE, SIZE);
     cr = cairo_create (target);
-    cairo_scale (cr, 72./ppi, 72./ppi);
+    cairo_scale (cr, 72./ppi_x, 72./ppi_y);
     cairo_set_source_surface (cr, surface, 0, 0);
     cairo_paint (cr);
 
@@ -303,18 +303,21 @@ main (void)
     cairo_test_status_t ret = CAIRO_TEST_UNTESTED;
     double ppi[] = { 600., 300., 150., 75., 72, 37.5 };
     unsigned int i;
-    int page, num_pages;
+    int ppi_x, ppi_y, num_ppi;
 
-    num_pages = sizeof (ppi) / sizeof (ppi[0]);
+    num_ppi = sizeof (ppi) / sizeof (ppi[0]);
 
     cairo_test_init (&ctx, "fallback-resolution");
 
 #if GENERATE_REFERENCE
-    for (page = 0; page < num_pages; page++) {
-	char *ref_name;
-	xasprintf (&ref_name, "fallback-resolution-ppi%g-ref.png", ppi[page]);
-	generate_reference (ppi[page], ref_name);
-	free (ref_name);
+    for (ppi_x = 0; ppi_x < num_ppi; ppi_x++) {
+	for (ppi_y = 0; ppi_y < num_ppi; ppi_y++) {
+	    char *ref_name;
+	    xasprintf (&ref_name, "fallback-resolution-ppi%gx%g-ref.png",
+		       ppi[ppi_x], ppi[ppi_y]);
+	    generate_reference (ppi[ppi_x], ppi[ppi_y], ref_name);
+	    free (ref_name);
+	}
     }
 #endif
 
@@ -335,7 +338,7 @@ main (void)
 		   format);
 
 	surface = (target->create_surface) (base_name,
-		                            target->content,
+					    target->content,
 					    SIZE, SIZE,
 					    SIZE, SIZE,
 					    CAIRO_BOILERPLATE_MODE_TEST,
@@ -358,102 +361,106 @@ main (void)
 	/* we need to recreate the surface for each resolution as we include
 	 * SVG in testing which does not support the paginated interface.
 	 */
-	for (page = 0; page < num_pages; page++) {
-	    char *test_name;
-	    cairo_bool_t pass;
-
-	    xasprintf (&test_name, "fallback-resolution-ppi%g",
-		       ppi[page]);
-	    xasprintf (&base_name, "%s-%s-%s",
-		       test_name,
-		       target->name,
-		       format);
-
-	    surface = (target->create_surface) (base_name,
-						target->content,
-						SIZE + 25, SIZE + 25,
-						SIZE + 25, SIZE + 25,
-						CAIRO_BOILERPLATE_MODE_TEST,
-						0,
-						&closure);
-	    if (surface == NULL || cairo_surface_status (surface)) {
-		cairo_test_log (&ctx, "Failed to generate surface: %s-%s\n",
-		    target->name,
-		    format);
-		free (base_name);
-		ret = CAIRO_TEST_FAILURE;
-		continue;
-	    }
-
-	    cairo_test_log (&ctx, "Testing fallback-resolution %g with %s target\n", ppi[page], target->name);
-	    printf ("%s:\t", base_name);
-	    fflush (stdout);
-
-	    if (target->force_fallbacks != NULL)
-		target->force_fallbacks (surface, ~0U);
-	    cr = cairo_create (surface);
+	for (ppi_x = 0; ppi_x < num_ppi; ppi_x++) {
+	    for (ppi_y = 0; ppi_y < num_ppi; ppi_y++) {
+		char *test_name;
+		cairo_bool_t pass;
+
+		xasprintf (&test_name, "fallback-resolution-ppi%gx%g",
+			   ppi[ppi_x], ppi[ppi_y]);
+		xasprintf (&base_name, "%s-%s-%s",
+			   test_name,
+			   target->name,
+			   format);
+
+		surface = (target->create_surface) (base_name,
+						    target->content,
+						    SIZE + 25, SIZE + 25,
+						    SIZE + 25, SIZE + 25,
+						    CAIRO_BOILERPLATE_MODE_TEST,
+						    0,
+						    &closure);
+		if (surface == NULL || cairo_surface_status (surface)) {
+		    cairo_test_log (&ctx, "Failed to generate surface: %s-%s\n",
+				    target->name,
+				    format);
+		    free (base_name);
+		    ret = CAIRO_TEST_FAILURE;
+		    continue;
+		}
+
+		cairo_test_log (&ctx,
+				"Testing fallback-resolution %gx%g with %s target\n",
+				ppi[ppi_x], ppi[ppi_y], target->name);
+		printf ("%s:\t", base_name);
+		fflush (stdout);
+
+		if (target->force_fallbacks != NULL)
+		    target->force_fallbacks (surface, ~0U);
+		cr = cairo_create (surface);
 #if SET_TOLERANCE
-	    cairo_set_tolerance (cr, 3.0);
+		cairo_set_tolerance (cr, 3.0);
 #endif
 
-	    cairo_surface_set_device_offset (surface, 25, 25);
-	    cairo_surface_set_fallback_resolution (surface,
-		                                   ppi[page], ppi[page]);
+		cairo_surface_set_device_offset (surface, 25, 25);
+		cairo_surface_set_fallback_resolution (surface,
+						       ppi[ppi_x], ppi[ppi_y]);
 
-	    cairo_save (cr); {
-		cairo_set_source_rgb (cr, 1, 1, 1);
-		cairo_paint (cr);
-	    } cairo_restore (cr);
+		cairo_save (cr); {
+		    cairo_set_source_rgb (cr, 1, 1, 1);
+		    cairo_paint (cr);
+		} cairo_restore (cr);
 
-	    /* First draw the top half in a conventional way. */
-	    cairo_save (cr); {
-		cairo_rectangle (cr, 0, 0, SIZE, SIZE / 2.0);
-		cairo_clip (cr);
+		/* First draw the top half in a conventional way. */
+		cairo_save (cr); {
+		    cairo_rectangle (cr, 0, 0, SIZE, SIZE / 2.0);
+		    cairo_clip (cr);
 
-		draw (cr, SIZE, SIZE);
-	    } cairo_restore (cr);
+		    draw (cr, SIZE, SIZE);
+		} cairo_restore (cr);
 
-	    /* Then draw the bottom half in a separate group,
-	     * (exposing a bug in 1.6.4 with the group not being
-	     * rendered with the correct fallback resolution). */
-	    cairo_save (cr); {
-		cairo_rectangle (cr, 0, SIZE / 2.0, SIZE, SIZE / 2.0);
-		cairo_clip (cr);
+		/* Then draw the bottom half in a separate group,
+		 * (exposing a bug in 1.6.4 with the group not being
+		 * rendered with the correct fallback resolution). */
+		cairo_save (cr); {
+		    cairo_rectangle (cr, 0, SIZE / 2.0, SIZE, SIZE / 2.0);
+		    cairo_clip (cr);
 
-		cairo_push_group (cr); {
-		    draw (cr, SIZE, SIZE);
-		} cairo_pop_group_to_source (cr);
-
-		cairo_paint (cr);
-	    } cairo_restore (cr);
-
-	    status = cairo_status (cr);
-	    cairo_destroy (cr);
-
-	    pass = FALSE;
-	    if (status) {
-		cairo_test_log (&ctx, "Error: Failed to create target surface: %s\n",
-			        cairo_status_to_string (status));
-		ret = CAIRO_TEST_FAILURE;
-	    } else {
-		/* extract the image and compare it to our reference */
-		if (! check_result (&ctx, target, test_name, base_name, surface))
+		    cairo_push_group (cr); {
+			draw (cr, SIZE, SIZE);
+		    } cairo_pop_group_to_source (cr);
+
+		    cairo_paint (cr);
+		} cairo_restore (cr);
+
+		status = cairo_status (cr);
+		cairo_destroy (cr);
+
+		pass = FALSE;
+		if (status) {
+		    cairo_test_log (&ctx, "Error: Failed to create target surface: %s\n",
+				    cairo_status_to_string (status));
 		    ret = CAIRO_TEST_FAILURE;
-		else
-		    pass = TRUE;
-	    }
-	    cairo_surface_destroy (surface);
-	    if (target->cleanup)
-		target->cleanup (closure);
+		} else {
+		    /* extract the image and compare it to our reference */
+		    if (! check_result (&ctx, target, test_name, base_name, surface))
+			ret = CAIRO_TEST_FAILURE;
+		    else
+			pass = TRUE;
+		}
+		cairo_surface_destroy (surface);
+		if (target->cleanup)
+		    target->cleanup (closure);
 
-	    free (base_name);
+		free (base_name);
 
-	    if (pass) {
-		printf ("PASS\n");
-	    } else {
-		printf ("FAIL\n");
+		if (pass) {
+		    printf ("PASS\n");
+		} else {
+		    printf ("FAIL\n");
+		}
+		fflush (stdout);
 	    }
-	    fflush (stdout);
 	}
     }
 
commit 0d3e152d2fe28b22a27dd6b9f82e2047aea3be94
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Oct 14 13:44:47 2008 +0100

    [check-doc-syntax.sh] Allow quoting.
    
    func_regexp was incorrectly complaining that cairo_pure was a function without
    parenthesis. The simplest solution appeared to be allow quoting of
    'cairo_pure'.

diff --git a/src/cairo-compiler-private.h b/src/cairo-compiler-private.h
index 5195583..b93fd82 100644
--- a/src/cairo-compiler-private.h
+++ b/src/cairo-compiler-private.h
@@ -115,20 +115,20 @@
  * Cairo uses the following function attributes in order to improve the
  * generated code (effectively by manual inter-procedural analysis).
  *
- *   cairo_pure: The function is only allowed to read from its arguments
- *               and global memory (i.e. following a pointer argument or
- *               accessing a shared variable). The return value should
- *               only depend on its arguments, and for an identical set of
- *               arguments should return the same value.
+ *   'cairo_pure': The function is only allowed to read from its arguments
+ *                 and global memory (i.e. following a pointer argument or
+ *                 accessing a shared variable). The return value should
+ *                 only depend on its arguments, and for an identical set of
+ *                 arguments should return the same value.
  *
- *   cairo_cont: The function is only allowed to read from its arguments.
- *               It is not allowed to access global memory. The return
- *               value should only depend its arguments, and for an identical
- *               set of arguments should return the same value.  This is
- *               currently the most strict function attribute.
+ *   'cairo_const': The function is only allowed to read from its arguments.
+ *                  It is not allowed to access global memory. The return
+ *                  value should only depend its arguments, and for an
+ *                  identical set of arguments should return the same value.
+ *                  This is currently the most strict function attribute.
  *
  * Both these function attributes allow gcc to perform CSE and
- * constant-folding, with cairo_const also guaranteeing that pointer contents
+ * constant-folding, with 'cairo_const 'also guaranteeing that pointer contents
  * do not change across the function call.
  */
 #if __GNUC__ >= 3
diff --git a/src/check-doc-syntax.sh b/src/check-doc-syntax.sh
index 9079e4a..abf526d 100755
--- a/src/check-doc-syntax.sh
+++ b/src/check-doc-syntax.sh
@@ -25,7 +25,7 @@ if test "x$SGML_DOCS" = x; then
     fi
 fi
 
-enum_regexp='\([^%@]\|^\)\<\(FALSE\|TRUE\|NULL\|CAIRO_[0-9A-Z_]*\)\($\|[^(A-Za-z0-9_]\)'
+enum_regexp="\([^%@']\|^\)\<\(FALSE\|TRUE\|NULL\|CAIRO_[0-9A-Z_]*\)\($\|[^(A-Za-z0-9_]\)"
 if test "x$SGML_DOCS" = x; then
 	enum_regexp='^[^:]*:[/ ][*]\(\|[ \t].*\)'$enum_regexp
 fi
@@ -36,7 +36,7 @@ if echo $FILES | xargs grep . /dev/null | sed -e '/<programlisting>/,/<\/program
 	echo "	'$enum_regexp'"
 fi >&2
 
-type_regexp='\( .*[^#]\| \|^\)\<cairo[0-9a-z_]*_t\>\($\|[^:]$\|[^:].\)'
+type_regexp="\( .*[^#']\| \|^\)\<cairo[0-9a-z_]*_t\>\($\|[^:]$\|[^:].\)"
 if test "x$SGML_DOCS" = x; then
 	type_regexp='^[^:]*:[/ ][*]'$type_regexp
 else
@@ -51,7 +51,7 @@ if echo $FILES | xargs grep . /dev/null | sed -e '/<programlisting>/,/<\/program
 	echo "	'$type_regexp'"
 fi >&2
 
-func_regexp='\([^#]\|^\)\<\(cairo_[][<>/0-9a-z_]*\>[^][<>(]\)'
+func_regexp="\([^#']\|^\)\<\(cairo_[][<>/0-9a-z_]*\>[^][<>(]\)"
 if test "x$SGML_DOCS" = x; then
 	func_regexp='^[^:]*:[/ ][*]\(\|[ \t].*\)'$func_regexp
 fi
commit 02a7ca80f9f9b62deff6c8ba4dc58fee0cebcaa6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Oct 14 11:08:43 2008 +0100

    [pattern] Correctly optimize away fractional translations.
    
    As is so often the case, reading the commit log gives you fresh insight in
    the problem - often called confessional debugging...
    
    We can simplify the problem by ignoring attr->[xy]_offset, for the time
    being, and focus on computing the correct matrix. This is comparatively
    simple as all we need to do is perform the appropriate rounding on the
    translation vector.

diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 48aa56b..d83142a 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -1757,10 +1757,10 @@ _cairo_pattern_analyze_filter (cairo_surface_pattern_t *pattern,
 }
 
 
-static int
+static double
 _pixman_nearest_sample (double d)
 {
-    return _cairo_lround (ceil (d - .5));
+    return ceil (d - .5);
 }
 
 static cairo_int_status_t
@@ -1800,17 +1800,19 @@ _cairo_pattern_acquire_surface_for_surface (cairo_surface_pattern_t   *pattern,
 	attr->matrix = pattern->base.matrix;
 	attr->matrix.x0 = 0;
 	attr->matrix.y0 = 0;
-	if (_cairo_matrix_is_identity (&attr->matrix)) {
+	if (_cairo_matrix_is_pixel_exact (&attr->matrix)) {
 	    /* The rounding here is rather peculiar as it needs to match the
 	     * rounding performed on the sample coordinate used by pixman.
 	     */
-	    attr->x_offset = tx = _pixman_nearest_sample (pattern->base.matrix.x0);
-	    attr->y_offset = ty = _pixman_nearest_sample (pattern->base.matrix.y0);
+	    attr->matrix.x0 = _pixman_nearest_sample (pattern->base.matrix.x0);
+	    attr->matrix.y0 = _pixman_nearest_sample (pattern->base.matrix.y0);
 	} else {
-	    attr->matrix = pattern->base.matrix;
-	    attr->x_offset = attr->y_offset = 0;
-	    tx = ty = 0;
+	    attr->matrix.x0 = pattern->base.matrix.x0;
+	    attr->matrix.y0 = pattern->base.matrix.y0;
 	}
+
+	attr->x_offset = attr->y_offset = 0;
+	tx = ty = 0;
     }
     else
     {


More information about the cairo-commit mailing list