Add more rounded-rect intersection tests

Add rounded rect intersection tests with difficult rounded rects
where the corners are not disjoint (the 'evil eye').

The first half of these tests were provided by Benjamin Otte
in #6440, the other half was added by me to cover the flipped
version of the evil eye.
This commit is contained in:
Matthias Clasen 2024-02-14 08:07:20 -05:00
parent fdff21ae13
commit 370ecd5d15

View File

@ -212,6 +212,40 @@ test_intersect_with_rect (void)
ROUNDED_RECT_INIT (0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (-200, 0, 200, 100, 0, 0, 0, 40), GRAPHENE_RECT_INIT (-200, 0, 160, 100),
ROUNDED_RECT_INIT_UNIFORM (-200, 0, 160, 100, 0, 0, 0, 40), GSK_INTERSECTION_NONEMPTY },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 50, 0, 50, 0), GRAPHENE_RECT_INIT (0, 0, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 50, 0, 50, 0), GRAPHENE_RECT_INIT (1, 0, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 50, 0, 50, 0), GRAPHENE_RECT_INIT (0, 1, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 50, 0, 50, 0), GRAPHENE_RECT_INIT (1, 1, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 0, 50, 0, 50), GRAPHENE_RECT_INIT (0, 0, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 0, 50, 0, 50), GRAPHENE_RECT_INIT (1, 0, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 0, 50, 0, 50), GRAPHENE_RECT_INIT (0, 1, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 0, 50, 0, 50), GRAPHENE_RECT_INIT (1, 1, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 0, 50, 0, 50), GRAPHENE_RECT_INIT (0, 0, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 0, 50, 0, 50), GRAPHENE_RECT_INIT (1, 0, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 0, 50, 0, 50), GRAPHENE_RECT_INIT (0, 1, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 50, 0, 50, 0), GRAPHENE_RECT_INIT (1, 1, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 50, 0, 50, 0), GRAPHENE_RECT_INIT (0, 0, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 50, 0, 50, 0), GRAPHENE_RECT_INIT (1, 0, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 50, 0, 50, 0), GRAPHENE_RECT_INIT (0, 1, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
{ ROUNDED_RECT_INIT_UNIFORM (0, 0, 50, 50, 50, 0, 50, 0), GRAPHENE_RECT_INIT (1, 1, 49, 49),
ROUNDED_RECT_INIT_UNIFORM (0, 0, 0, 0, 0, 0, 0, 0), GSK_INTERSECTION_NOT_REPRESENTABLE },
};
for (unsigned int i = 0; i < G_N_ELEMENTS (test); i++)