mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 04:08:13 +02:00
[test] Expand in-fill-trapezoid
Test vertices and edges of a rectangle to probe 'corner-cases', using the insideness conditions from flash.
This commit is contained in:
parent
cebc84f367
commit
9afad53730
1 changed files with 34 additions and 0 deletions
|
|
@ -42,6 +42,40 @@ draw (cairo_t *cr, int width, int height)
|
|||
ret = CAIRO_TEST_FAILURE;
|
||||
}
|
||||
|
||||
/* rectangular boundary tests */
|
||||
if (cairo_in_fill (cr, -10, -10)) {
|
||||
cairo_test_log (ctx, "Error: Found top-left vertex inside rectangle\n");
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
}
|
||||
if (cairo_in_fill (cr, -10, 10)) {
|
||||
cairo_test_log (ctx, "Error: Found bottom-left vertex inside rectangle\n");
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
}
|
||||
if (! cairo_in_fill (cr, 10, -10)) {
|
||||
cairo_test_log (ctx, "Error: Failed to find top-right vertex inside rectangle\n");
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
}
|
||||
if (cairo_in_fill (cr, 10, 10)) {
|
||||
cairo_test_log (ctx, "Error: Found bottom-right vertex inside rectangle\n");
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
}
|
||||
if (cairo_in_fill (cr, -10, 0)) {
|
||||
cairo_test_log (ctx, "Error: Found left edge inside rectangle\n");
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
}
|
||||
if (! cairo_in_fill (cr, 0, -10)) {
|
||||
cairo_test_log (ctx, "Error: Failed to find top edge inside rectangle\n");
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
}
|
||||
if (! cairo_in_fill (cr, 10, 0)) {
|
||||
cairo_test_log (ctx, "Error: Failed to find right edge inside rectangle\n");
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
}
|
||||
if (cairo_in_fill (cr, 0, 10)) {
|
||||
cairo_test_log (ctx, "Error: Found bottom edge inside rectangle\n");
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
}
|
||||
|
||||
/* simple circle */
|
||||
cairo_new_path (cr);
|
||||
cairo_arc (cr, 0, 0, 10, 0, 2 * M_PI);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue