Commits on Source (5)
-
When the first vertex passed to the clipper is clipped into two vertices, the second vertex can sometimes be emitted as the first clipped vertices while the first vertex is emitted as the last one. A new utility function assert_vertices() is added to handle that case. The function also checks the number of clipped vertices and the clipped vertices in one go. Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
aca0b69a -
Simplify box and quad declarations using dedicated macros. Hard-coded literals are used instead of preprocessor constants for the sake of brevity and because, as several new tests will be added, it appears to be easier to understand those when values are inlined. Descriptions have been revised to better understand the intent of each test. Previous descriptions used a coord system with Y pointing up, new descriptions use Y pointing down in order to improve consistency with the rest of the code base and to have a common ground when talking about winding order. All the tests keep the same input values with the exception of the last 2 tests with (new) descriptions: "Rotated quad with edges adjacent to box corners" and "Rotated quad with edges cutting out box corners". These tests had a different winding order and have been modified so that all tests use a clockwise order (new axis convention). The last test also gets a counter-clockwise version in order to ensure the opposite winding order is correctly supported too. Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
60877f5f -
Add quad clipping tests checking intersections at all edges and corners of axis-aligned and unaligned quads with negative and positive values. Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
1f9637ec -
The non-zero area check of clipper_quad_clip() is incorrect for quads initialized with a polygon starting with a vertical edge. In order to handle polygons starting with an horizontal edge and polygons starting with a vertical one, it must check opposite vertices for equality. The test previously described as "Box intersects entire smaller aligned quad" is now described as "Clockwise winding and top/left initial vertex". This test keeps the same values as before but all combinations of winding order and first edge orientations are also tested. The QUAD() macro isn't used anymore to do so. Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
e82ce803 -
Add a few tests ensuring the box32 quad clipping wrapper works as expected. Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
5516527f
This diff is collapsed.