[test/in-fill-trapezoid] Add a few holes.

Complete the coverage of _cairo_trap_contains() by cutting holes out of
the simple shapes.
This commit is contained in:
Chris Wilson 2008-01-17 13:13:40 +00:00
parent da9c43329a
commit 390e22894b

View file

@ -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;
}