mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-04 04:50:31 +01:00
[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:
parent
da9c43329a
commit
390e22894b
1 changed files with 20 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue