summaryrefslogtreecommitdiff
path: root/test/in-fill-trapezoid.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-01-17 13:13:40 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2008-01-17 13:13:40 +0000
commit390e22894b093184e489ea762ffc29eeb1c81d2b (patch)
tree67e66be80e85720a83059357dfef2cffe774f272 /test/in-fill-trapezoid.c
parentda9c43329ad09ccf48f8a71d28848f111af7ecb5 (diff)
downloadcairo-390e22894b093184e489ea762ffc29eeb1c81d2b.tar.gz
[test/in-fill-trapezoid] Add a few holes.
Complete the coverage of _cairo_trap_contains() by cutting holes out of the simple shapes.
Diffstat (limited to 'test/in-fill-trapezoid.c')
-rw-r--r--test/in-fill-trapezoid.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/in-fill-trapezoid.c b/test/in-fill-trapezoid.c
index 0e9f0582d..a544e4392 100644
--- a/test/in-fill-trapezoid.c
+++ b/test/in-fill-trapezoid.c
@@ -40,6 +40,8 @@ draw (cairo_t *cr, int width, int height)
{
cairo_test_status_t ret = CAIRO_TEST_SUCCESS;
+ cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
+
/* simple rectangle */
cairo_new_path (cr);
cairo_rectangle (cr, -10, -10, 20, 20);
@@ -56,6 +58,24 @@ draw (cairo_t *cr, int width, int height)
ret = CAIRO_TEST_FAILURE;
}
+ /* holey rectangle */
+ cairo_new_path (cr);
+ cairo_rectangle (cr, -10, -10, 20, 20);
+ cairo_rectangle (cr, -5, -5, 10, 10);
+ if (cairo_in_fill (cr, 0, 0)) {
+ cairo_test_log ("Error: Found an unexpected point inside rectangular hole\n");
+ ret = CAIRO_TEST_FAILURE;
+ }
+
+ /* holey circle */
+ cairo_new_path (cr);
+ cairo_arc (cr, 0, 0, 10, 0, 2 * M_PI);
+ cairo_arc (cr, 0, 0, 5, 0, 2 * M_PI);
+ if (cairo_in_fill (cr, 0, 0)) {
+ cairo_test_log ("Error: Found an unexpected point inside circular hole\n");
+ ret = CAIRO_TEST_FAILURE;
+ }
+
return ret;
}