mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-18 06:00:47 +01:00
[test/get-path-extents] Check extents of degenerate paths.
Ensure that degenerate paths have zero extents.
This commit is contained in:
parent
3f202c081d
commit
dd13a00541
1 changed files with 35 additions and 0 deletions
|
|
@ -121,6 +121,41 @@ draw (cairo_t *cr, int width, int height)
|
|||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0))
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
|
||||
cairo_save (cr2);
|
||||
|
||||
cairo_new_path (cr2);
|
||||
cairo_move_to (cr2, 200, 400);
|
||||
cairo_rel_line_to (cr2, 0., 0.);
|
||||
phase = "Degenerate line";
|
||||
if (!check_extents (phase, cr2, FILL, EQUALS, 0, 0, 0, 0) ||
|
||||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0))
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
|
||||
cairo_new_path (cr2);
|
||||
cairo_move_to (cr2, 200, 400);
|
||||
cairo_rel_curve_to (cr2, 0., 0., 0., 0., 0., 0.);
|
||||
phase = "Degenerate curve";
|
||||
if (!check_extents (phase, cr2, FILL, EQUALS, 0, 0, 0, 0) ||
|
||||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0))
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
|
||||
cairo_new_path (cr2);
|
||||
cairo_arc (cr2, 200, 400, 0., 0, 2 * M_PI);
|
||||
phase = "Degenerate arc (R=0)";
|
||||
if (!check_extents (phase, cr2, FILL, EQUALS, 0, 0, 0, 0) ||
|
||||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0))
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
|
||||
cairo_new_path (cr2);
|
||||
cairo_arc (cr2, 200, 400, 10., 0, 0);
|
||||
phase = "Degenerate arc (Θ=0)";
|
||||
if (!check_extents (phase, cr2, FILL, EQUALS, 0, 0, 0, 0) ||
|
||||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0))
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
|
||||
cairo_new_path (cr2);
|
||||
cairo_restore (cr2);
|
||||
|
||||
/* http://bugs.freedesktop.org/show_bug.cgi?id=7965 */
|
||||
phase = "A vertical, open path";
|
||||
cairo_save (cr2);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue