[cairo-commit] 3 commits - test/big-empty-box.argb32.ref.png test/big-empty-box.c test/big-empty-box.rgb24.ref.png test/big-empty-triangle.argb32.ref.png test/big-empty-triangle.c test/big-empty-triangle.rgb24.ref.png test/big-little-triangle.argb32.ref.png test/big-little-triangle.c test/big-little-triangle.rgb24.ref.png test/Makefile.refs test/Makefile.sources

Chris Wilson ickle at kemper.freedesktop.org
Mon Aug 29 07:59:10 PDT 2011


 test/Makefile.refs                      |    6 ++
 test/Makefile.sources                   |    3 +
 test/big-empty-box.argb32.ref.png       |binary
 test/big-empty-box.c                    |   64 ++++++++++++++++++++++++++
 test/big-empty-box.rgb24.ref.png        |binary
 test/big-empty-triangle.argb32.ref.png  |binary
 test/big-empty-triangle.c               |   75 +++++++++++++++++++++++++++++++
 test/big-empty-triangle.rgb24.ref.png   |binary
 test/big-little-triangle.argb32.ref.png |binary
 test/big-little-triangle.c              |   76 ++++++++++++++++++++++++++++++++
 test/big-little-triangle.rgb24.ref.png  |binary
 11 files changed, 224 insertions(+)

New commits:
commit 7ae2708fc8cf5a4983b4a805a4abe3b018b4aff4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Aug 29 15:56:46 2011 +0100

    test: Add big-empty-triangle
    
    One last variant to make sure we handle the case of the disappearing
    unbounded triangle.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/test/Makefile.refs b/test/Makefile.refs
index 7fd4f1d..d1ae2b0 100644
--- a/test/Makefile.refs
+++ b/test/Makefile.refs
@@ -46,6 +46,8 @@ REFERENCE_IMAGES = \
 	arc-looping-dash.ref.png \
 	big-empty-box.argb32.ref.png \
 	big-empty-box.rgb24.ref.png \
+	big-empty-triangle.argb32.ref.png \
+	big-empty-triangle.rgb24.ref.png \
 	big-line.image16.ref.png \
 	big-line.ps.ref.png \
 	big-line.quartz.ref.png \
diff --git a/test/Makefile.sources b/test/Makefile.sources
index 0faf235..1fa7b78 100644
--- a/test/Makefile.sources
+++ b/test/Makefile.sources
@@ -16,6 +16,7 @@ test_sources = \
 	api-special-cases.c				\
 	big-line.c					\
 	big-empty-box.c					\
+	big-empty-triangle.c				\
 	big-little-box.c				\
 	big-little-triangle.c				\
 	big-trap.c					\
diff --git a/test/big-empty-triangle.argb32.ref.png b/test/big-empty-triangle.argb32.ref.png
new file mode 100644
index 0000000..a88d3b6
Binary files /dev/null and b/test/big-empty-triangle.argb32.ref.png differ
diff --git a/test/big-empty-triangle.c b/test/big-empty-triangle.c
new file mode 100644
index 0000000..4c02c87
--- /dev/null
+++ b/test/big-empty-triangle.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * 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: Chris Wilson <chris at chris-wilson.co.uk>
+ */
+
+/*
+ * A variation on
+ *
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=668921
+ *
+ * The issue is that we failed to tighten the initial approximated bounds
+ * after tessellating the path.
+ */
+
+#include "cairo-test.h"
+
+#define SIZE 60
+
+static void
+triangle (cairo_t *cr, double x, double y, double h)
+{
+    cairo_move_to (cr, x, y);
+    cairo_line_to (cr, x+h/2, y+h);
+    cairo_line_to (cr, x+h, y);
+    cairo_close_path (cr);
+}
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+    cairo_set_source_rgb (cr, 1, 0, 1);
+    cairo_paint (cr);
+
+    /* Set an unbounded operator so that we can see how accurate the bounded
+     * extents were.
+     */
+    cairo_set_operator (cr, CAIRO_OPERATOR_IN);
+    cairo_set_source_rgb (cr, 1, 1, 1);
+
+    /* Wind several triangles together that reduce to nothing */
+    cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
+    triangle (cr, 0, 0, SIZE);
+    triangle (cr, 0, 0, SIZE);
+    cairo_fill (cr);
+
+    return CAIRO_TEST_SUCCESS;
+}
+
+CAIRO_TEST (big_empty_triangle,
+	    "Tests that we tighten the bounds after tessellation.",
+	    "fill", /* keywords */
+	    NULL, /* requirements */
+	    SIZE, SIZE,
+	    NULL, draw)
diff --git a/test/big-empty-triangle.rgb24.ref.png b/test/big-empty-triangle.rgb24.ref.png
new file mode 100644
index 0000000..6c2ca32
Binary files /dev/null and b/test/big-empty-triangle.rgb24.ref.png differ
commit f71cfe84fe14959f41be0658db04a260bfb091e9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Aug 29 15:54:11 2011 +0100

    test: Add big-empty-box
    
    Another variant on big-little-box, to make sure we trim the extents
    before doing the empty unbounded fixup.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/test/Makefile.refs b/test/Makefile.refs
index ddcbf70..7fd4f1d 100644
--- a/test/Makefile.refs
+++ b/test/Makefile.refs
@@ -44,6 +44,8 @@ REFERENCE_IMAGES = \
 	arc-looping-dash.ps.ref.png \
 	arc-looping-dash.quartz.ref.png \
 	arc-looping-dash.ref.png \
+	big-empty-box.argb32.ref.png \
+	big-empty-box.rgb24.ref.png \
 	big-line.image16.ref.png \
 	big-line.ps.ref.png \
 	big-line.quartz.ref.png \
diff --git a/test/Makefile.sources b/test/Makefile.sources
index 25add4f..0faf235 100644
--- a/test/Makefile.sources
+++ b/test/Makefile.sources
@@ -15,6 +15,7 @@ test_sources = \
 	arc-looping-dash.c				\
 	api-special-cases.c				\
 	big-line.c					\
+	big-empty-box.c					\
 	big-little-box.c				\
 	big-little-triangle.c				\
 	big-trap.c					\
diff --git a/test/big-empty-box.argb32.ref.png b/test/big-empty-box.argb32.ref.png
new file mode 100644
index 0000000..a88d3b6
Binary files /dev/null and b/test/big-empty-box.argb32.ref.png differ
diff --git a/test/big-empty-box.c b/test/big-empty-box.c
new file mode 100644
index 0000000..4ea91a1
--- /dev/null
+++ b/test/big-empty-box.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * 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: Chris Wilson <chris at chris-wilson.co.uk>
+ */
+
+/*
+ * The mystery of the disappearing box, similar to big-little-box.
+ *
+ * The issue is that we failed to tighten the initial approximated bounds
+ * after tessellating the path.
+ */
+
+#include "cairo-test.h"
+
+#define SIZE 60
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+    cairo_set_source_rgb (cr, 1, 0, 1);
+    cairo_paint (cr);
+
+    /* Set an unbounded operator so that we can see how accurate the bounded
+     * extents were.
+     */
+    cairo_set_operator (cr, CAIRO_OPERATOR_IN);
+    cairo_set_source_rgb (cr, 1, 1, 1);
+
+    /* Wind several boxes together that reduce to nothing */
+    cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
+    cairo_rectangle (cr, 0, 0, SIZE, SIZE);
+    cairo_rectangle (cr, 0, 0, SIZE, SIZE);
+    cairo_fill (cr);
+
+    return CAIRO_TEST_SUCCESS;
+}
+
+CAIRO_TEST (big_empty_box,
+	    "Tests that we tighten the bounds after tessellation.",
+	    "fill", /* keywords */
+	    NULL, /* requirements */
+	    SIZE, SIZE,
+	    NULL, draw)
diff --git a/test/big-empty-box.rgb24.ref.png b/test/big-empty-box.rgb24.ref.png
new file mode 100644
index 0000000..6c2ca32
Binary files /dev/null and b/test/big-empty-box.rgb24.ref.png differ
commit 249c89c313598487b5eab1a93a06ac9ebcc173b3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Aug 29 15:48:42 2011 +0100

    test: Add big-little-triangle
    
    A variant on big-little-triangle to exercise the non-rectangular paths.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/test/Makefile.refs b/test/Makefile.refs
index 0db6208..ddcbf70 100644
--- a/test/Makefile.refs
+++ b/test/Makefile.refs
@@ -51,6 +51,8 @@ REFERENCE_IMAGES = \
 	big-line.xlib.ref.png \
 	big-little-box.argb32.ref.png \
 	big-little-box.rgb24.ref.png \
+	big-little-triangle.argb32.ref.png \
+	big-little-triangle.rgb24.ref.png \
 	bilevel-image.ref.png \
 	bitmap-font.ref.png \
 	bitmap-font.rgb24.ref.png \
diff --git a/test/Makefile.sources b/test/Makefile.sources
index 7289615..25add4f 100644
--- a/test/Makefile.sources
+++ b/test/Makefile.sources
@@ -16,6 +16,7 @@ test_sources = \
 	api-special-cases.c				\
 	big-line.c					\
 	big-little-box.c				\
+	big-little-triangle.c				\
 	big-trap.c					\
 	bilevel-image.c					\
 	bug-40410.c					\
diff --git a/test/big-little-triangle.argb32.ref.png b/test/big-little-triangle.argb32.ref.png
new file mode 100644
index 0000000..1c2522f
Binary files /dev/null and b/test/big-little-triangle.argb32.ref.png differ
diff --git a/test/big-little-triangle.c b/test/big-little-triangle.c
new file mode 100644
index 0000000..27eb232
--- /dev/null
+++ b/test/big-little-triangle.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * 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: Chris Wilson <chris at chris-wilson.co.uk>
+ */
+
+/*
+ * A variation on
+ *
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=668921
+ *
+ * The issue is that we failed to tighten the initial approximated bounds
+ * after tessellating the path.
+ */
+
+#include "cairo-test.h"
+
+#define SIZE 60
+
+static void
+triangle (cairo_t *cr, double x, double y, double h)
+{
+    cairo_move_to (cr, x, y);
+    cairo_line_to (cr, x+h/2, y+h);
+    cairo_line_to (cr, x+h, y);
+    cairo_close_path (cr);
+}
+
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
+{
+    cairo_set_source_rgb (cr, 1, 0, 1);
+    cairo_paint (cr);
+
+    /* Set an unbounded operator so that we can see how accurate the bounded
+     * extents were.
+     */
+    cairo_set_operator (cr, CAIRO_OPERATOR_IN);
+    cairo_set_source_rgb (cr, 1, 1, 1);
+
+    /* Wind several triangles together that reduce to just one */
+    cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
+    triangle (cr, 0, 0, SIZE);
+    triangle (cr, 0, 0, SIZE);
+    triangle (cr, SIZE/2-20, SIZE/2 - 20, 40);
+    cairo_fill (cr);
+
+    return CAIRO_TEST_SUCCESS;
+}
+
+CAIRO_TEST (big_little_triangle,
+	    "Tests that we tighten the bounds after tessellation.",
+	    "fill", /* keywords */
+	    NULL, /* requirements */
+	    SIZE, SIZE,
+	    NULL, draw)
diff --git a/test/big-little-triangle.rgb24.ref.png b/test/big-little-triangle.rgb24.ref.png
new file mode 100644
index 0000000..24fc472
Binary files /dev/null and b/test/big-little-triangle.rgb24.ref.png differ


More information about the cairo-commit mailing list