diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-12 15:14:17 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-12 15:14:17 +0100 |
commit | 968374b6335199cbf02c8c4733537388da2a45f5 (patch) | |
tree | af517c52f7e1451ce624faf9d1845300df912041 /test | |
parent | 299263f8c912d3468d51ed22bcb6ab96275709f0 (diff) |
test/coverage: Add a comment describing the column_triangle geometry()
Diffstat (limited to 'test')
-rw-r--r-- | test/coverage.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/coverage.c b/test/coverage.c index d77b1e33..c2dd3986 100644 --- a/test/coverage.c +++ b/test/coverage.c @@ -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); |