test/coverage: Add a comment describing the column_triangle geometry()

This commit is contained in:
Chris Wilson 2010-06-12 15:14:17 +01:00
parent 299263f8c9
commit 968374b633

View file

@ -270,6 +270,22 @@ column_triangles (cairo_t *cr, int width, int height)
for (i = 0; i < PRECISION; i++) {
double dy = random_offset (WIDTH - x, FALSE);
/*
* We want to test some sharing of edges to further
* stress the rasterisers, so instead of using one
* tall triangle, it is split into two, with vertical
* edges on either side that may co-align with their
* neighbours:
*
* --- . ---
* 1 / | |\ |
* / 2x | | \ |
* --- .... | 1 / x
* \ | |
* \| |
* . ---
*/
cairo_move_to (cr, x + i / (double) PRECISION, y + dy);
cairo_rel_line_to (cr, 0, step);
cairo_rel_line_to (cr, 1 / (double) PRECISION, step);
@ -317,6 +333,10 @@ row_triangles (cairo_t *cr, int width, int height)
for (i = 0; i < PRECISION; i++) {
double dx = random_offset (WIDTH - x, FALSE);
/* See column_triangles() for a transposed description
* of this geometry.
*/
cairo_move_to (cr, x + dx, y + i / (double) PRECISION);
cairo_rel_line_to (cr, step, 0);
cairo_rel_line_to (cr, step, 1 / (double) PRECISION);