[cairo-commit] 4 commits - boilerplate/cairo-boilerplate.c src/cairo-bentley-ottmann.c test/fill-degenerate-sort-order.c test/fill-degenerate-sort-order-ref.png test/fill-degenerate-sort-order-rgb24-ref.png test/fill-missed-stop.c test/in-fill-empty-trapezoid.c test/in-fill-empty-trapezoid-ref.png test/in-fill-empty-trapezoid-rgb24-ref.png test/Makefile.am

M. Joonas Pihlaja joonas at kemper.freedesktop.org
Wed Dec 6 16:49:20 PST 2006


 boilerplate/cairo-boilerplate.c               |    3 
 dev/null                                      |binary
 src/cairo-bentley-ottmann.c                   |    2 
 test/Makefile.am                              |    2 
 test/fill-degenerate-sort-order-ref.png       |binary
 test/fill-degenerate-sort-order-rgb24-ref.png |binary
 test/fill-degenerate-sort-order.c             |   69 ++++++-------------
 test/fill-missed-stop.c                       |   37 +++++-----
 test/in-fill-empty-trapezoid-ref.png          |    0 
 test/in-fill-empty-trapezoid-rgb24-ref.png    |    0 
 test/in-fill-empty-trapezoid.c                |   91 ++++++++++++++------------
 11 files changed, 95 insertions(+), 109 deletions(-)

New commits:
diff-tree 6301f92d2af2fd7928352965bcab42bab9deb59d (from c13a1a2ed0ce8ba2b43e4e70c66cdc5b98e80eb4)
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date:   Thu Dec 7 02:30:41 2006 +0200

    Rework the in-fill-empty-trapezoid test to not use the cairo_test() framework.
    
    As suggested by Behdad Esfahbod, we can not use the cairo_test() framework
    when it is getting in the way.  The test itself doesn't depend on any
    particular backend.
    
    http://lists.freedesktop.org/archives/cairo/2006-December/008809.html

diff --git a/test/Makefile.am b/test/Makefile.am
index b840d4d..3b1f6b9 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -245,8 +245,6 @@ glyph-cache-pressure-ps-argb32-ref.png		
 glyph-cache-pressure-svg-ref.png			\
 gradient-alpha-ref.png					\
 gradient-alpha-rgb24-ref.png				\
-in-fill-empty-trapezoid-ref.png				\
-in-fill-empty-trapezoid-rgb24-ref.png			\
 infinite-join-ref.png					\
 infinite-join-ps-argb32-ref.png				\
 leaky-dash-ref.png					\
diff --git a/test/in-fill-empty-trapezoid-ref.png b/test/in-fill-empty-trapezoid-ref.png
deleted file mode 100644
index 60ae617..0000000
Binary files a/test/in-fill-empty-trapezoid-ref.png and /dev/null differ
diff --git a/test/in-fill-empty-trapezoid-rgb24-ref.png b/test/in-fill-empty-trapezoid-rgb24-ref.png
deleted file mode 100644
index ef08ebb..0000000
Binary files a/test/in-fill-empty-trapezoid-rgb24-ref.png and /dev/null differ
diff --git a/test/in-fill-empty-trapezoid.c b/test/in-fill-empty-trapezoid.c
index 4986aec..58d347a 100644
--- a/test/in-fill-empty-trapezoid.c
+++ b/test/in-fill-empty-trapezoid.c
@@ -35,22 +35,22 @@
 
 #include "cairo-test.h"
 
-static cairo_test_draw_function_t draw;
-
-cairo_test_t test = {
-    "in-fill-empty-trapezoid",
-    "Tests that the tessellator doesn't produce obviously empty trapezoids",
-    10, 10,
-    draw
-};
-
-static cairo_test_status_t
-draw (cairo_t *cr_orig, int width, int height)
+int
+main (void)
 {
     int x,y;
+    int width = 10;
+    int height = 10;
     cairo_surface_t *surf = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
     cairo_t *cr = cairo_create (surf);
-    cairo_set_source_rgb (cr_orig, 1, 0, 0);
+    int false_positive_count = 0;
+    cairo_status_t status;
+    char const * description =
+	"Test that the tessellator isn't producing obviously empty trapezoids";
+
+    cairo_test_init ("in-fill-empty-trapezoid");
+    cairo_test_log ("%s\n", description);
+    printf ("%s\n", description);
 
     /* Empty horizontal trapezoid. */
     cairo_move_to (cr, 0, height/3);
@@ -67,24 +67,32 @@ draw (cairo_t *cr_orig, int width, int h
     cairo_line_to (cr, width, 0);
     cairo_close_path (cr);
 
-    /* Point sample the tessellated path. The x and y starting offsets
-     * are chosen to hit the nasty bits while still being able to do a
-     * relatively sparse sampling. */
+    status = cairo_status (cr);
+
+    /* Point sample the tessellated path. */
     for (y = 0; y < height; y++) {
 	for (x = 0; x < width; x++) {
 	    if (cairo_in_fill (cr, x, y)) {
-		cairo_rectangle(cr_orig, x, y, 1, 1);
-		cairo_fill (cr_orig);
+		false_positive_count++;
 	    }
 	}
     }
     cairo_destroy (cr);
     cairo_surface_destroy (surf);
-    return CAIRO_TEST_SUCCESS;
-}
 
-int
-main (void)
-{
-    return cairo_test (&test);
+    /* Check that everything went well. */
+    if (CAIRO_STATUS_SUCCESS != status) {
+	cairo_test_log ("Failed to create a test surface and path: %s\n",
+			cairo_status_to_string (status));
+	return CAIRO_TEST_FAILURE;
+    }
+
+    if (0 != false_positive_count) {
+	cairo_test_log ("Point sampling found %d false positives "
+			"from cairo_in_fill()\n",
+			false_positive_count);
+	return CAIRO_TEST_FAILURE;
+    }
+
+    return CAIRO_TEST_SUCCESS;
 }
diff-tree c13a1a2ed0ce8ba2b43e4e70c66cdc5b98e80eb4 (from 565a715d119d00ac141d1b235dab7985ed78113a)
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date:   Thu Dec 7 01:42:07 2006 +0200

    Replace point sampling in the fill-degenerate-sort-order with rendering.
    
    Clean up the test to not even check the ps backend as per:
    
    http://lists.freedesktop.org/archives/cairo/2006-December/008806.html

diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 33298dc..322a1c4 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -69,6 +69,9 @@ static const char *vector_ignored_tests[
     "text-antialias-none",
     "text-antialias-subpixel",
     "unantialiased-shapes",
+
+    /* Nor do we care about rendering anomalies in external renderers. */
+    "fill-degenerate-sort-order",
     NULL
 };
 
diff --git a/test/fill-degenerate-sort-order-ref.png b/test/fill-degenerate-sort-order-ref.png
index ca1f575..8278d76 100644
Binary files a/test/fill-degenerate-sort-order-ref.png and b/test/fill-degenerate-sort-order-ref.png differ
diff --git a/test/fill-degenerate-sort-order-rgb24-ref.png b/test/fill-degenerate-sort-order-rgb24-ref.png
index 999a09a..6c76eaf 100644
Binary files a/test/fill-degenerate-sort-order-rgb24-ref.png and b/test/fill-degenerate-sort-order-rgb24-ref.png differ
diff --git a/test/fill-degenerate-sort-order.c b/test/fill-degenerate-sort-order.c
index 68f64fd..570b373 100644
--- a/test/fill-degenerate-sort-order.c
+++ b/test/fill-degenerate-sort-order.c
@@ -47,22 +47,9 @@ cairo_test_t test = {
 
 /* Derived from zrusin's "another" polygon in the performance suite. */
 static cairo_test_status_t
-draw (cairo_t *cr_orig, int width, int height)
+draw (cairo_t *cr, int width, int height)
 {
-    /* XXX: I wanted to be able to simply fill the nasty path to the
-     * surface and then use a reference image to catch bugs, but the
-     * renderer used when testing the postscript backend gets the
-     * degeneracy wrong, thus leading to an (unfixable?) test case
-     * failure.  Are external renderer bugs our bugs too?  Instead,
-     * tessellate the polygon and render to the surface the results of
-     * point sampling the tessellated path.  If there would be a way
-     * to XFAIL only some backends we could do that for the .ps
-     * backend only. */
-    int x,y;
-    int sample_stride;
-    cairo_surface_t *surf = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
-    cairo_t *cr = cairo_create (surf);
-    cairo_set_source_rgb (cr_orig, 1, 0, 0);
+    cairo_set_source_rgb (cr, 1, 0, 0);
 
     /* The polygon uses (43,103) as its "base point".  Closed
      * subpaths are simulated by going from the base point to the
@@ -86,21 +73,8 @@ draw (cairo_t *cr_orig, int width, int h
     cairo_line_to (cr, 176, 110);
 
     cairo_close_path (cr);
+    cairo_fill (cr);
 
-    /* Point sample the tessellated path. The x and y starting offsets
-     * are chosen to hit the nasty bits while still being able to do a
-     * relatively sparse sampling. */
-    sample_stride = 4;
-    for (y = 0; y < height; y += sample_stride) {
-	for (x = 0; x < width; x += sample_stride) {
-	    if (cairo_in_fill (cr, x, y)) {
-		cairo_rectangle(cr_orig, x, y, sample_stride, sample_stride);
-		cairo_fill (cr_orig);
-	    }
-	}
-    }
-    cairo_destroy (cr);
-    cairo_surface_destroy (surf);
     return CAIRO_TEST_SUCCESS;
 }
 
diff-tree 565a715d119d00ac141d1b235dab7985ed78113a (from e857ac325a048799016196bc65ce6ff279c01431)
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date:   Thu Dec 7 01:16:43 2006 +0200

    Change license of tessellator tests to the MIT license.
    
    The blurb for the fill-degenerate-sort-order, fill-missed-stop and
    in-fill-empty-trapezoid tests changed to this one:
    
    http://www.opensource.org/licenses/mit-license.php
    
    c.f. http://lists.freedesktop.org/archives/cairo/2006-December/008806.html

diff --git a/test/fill-degenerate-sort-order.c b/test/fill-degenerate-sort-order.c
index 72c7a22..68f64fd 100644
--- a/test/fill-degenerate-sort-order.c
+++ b/test/fill-degenerate-sort-order.c
@@ -1,24 +1,25 @@
 /*
  * Copyright © 2006 M Joonas Pihlaja
  *
- * 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 Joonas Pihlaja
- * not be used in advertising or publicity pertaining to distribution
- * of the software without specific, written prior permission.
- * Joonas Pihlaja makes no representations about the suitability of this
- * software for any purpose.  It is provided "as is" without express
- * or implied warranty.
- *
- * JOONAS PIHLAJA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
- * NO EVENT SHALL JOONAS PIHLAJA BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
- * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
  *
  * Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
  */
diff --git a/test/fill-missed-stop.c b/test/fill-missed-stop.c
index cdf9ba5..f05b1aa 100644
--- a/test/fill-missed-stop.c
+++ b/test/fill-missed-stop.c
@@ -1,24 +1,25 @@
 /*
  * Copyright © 2006 M Joonas Pihlaja
  *
- * 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 Joonas Pihlaja
- * not be used in advertising or publicity pertaining to distribution
- * of the software without specific, written prior permission.
- * Joonas Pihlaja makes no representations about the suitability of this
- * software for any purpose.  It is provided "as is" without express
- * or implied warranty.
- *
- * JOONAS PIHLAJA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
- * NO EVENT SHALL JOONAS PIHLAJA BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
- * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
  *
  * Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
  */
diff --git a/test/in-fill-empty-trapezoid.c b/test/in-fill-empty-trapezoid.c
index 2999ec5..4986aec 100644
--- a/test/in-fill-empty-trapezoid.c
+++ b/test/in-fill-empty-trapezoid.c
@@ -1,24 +1,25 @@
 /*
  * Copyright © 2006 M Joonas Pihlaja
  *
- * 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 Joonas Pihlaja
- * not be used in advertising or publicity pertaining to distribution
- * of the software without specific, written prior permission.
- * Joonas Pihlaja makes no representations about the suitability of this
- * software for any purpose.  It is provided "as is" without express
- * or implied warranty.
- *
- * JOONAS PIHLAJA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
- * NO EVENT SHALL JOONAS PIHLAJA BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
- * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
  *
  * Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
  */
diff-tree e857ac325a048799016196bc65ce6ff279c01431 (from 16c0db0d6843184e79b73a3613f65c0cc06a684d)
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date:   Thu Dec 7 00:52:43 2006 +0200

    tessellator bug fix: linking fails on x86_64 due to superfluous inline attribute.
    
    Remove inline attribute from cairo_bo_event_compare_abstract()
    to fix the linking issue reported by Jinghua Luo on the mailing list:
    
    http://lists.freedesktop.org/archives/cairo/2006-November/008574.html

diff --git a/src/cairo-bentley-ottmann.c b/src/cairo-bentley-ottmann.c
index a0cd4a6..4a72a8d 100644
--- a/src/cairo-bentley-ottmann.c
+++ b/src/cairo-bentley-ottmann.c
@@ -442,7 +442,7 @@ cairo_bo_event_compare (cairo_bo_event_t
     return 0;
 }
 
-static inline int
+static int
 cairo_bo_event_compare_abstract (void		*list,
 				 void	*a,
 				 void	*b)


More information about the cairo-commit mailing list