mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-04 21:08:10 +02:00
test/coverage: Add a comment describing the column_triangle geometry()
This commit is contained in:
parent
299263f8c9
commit
968374b633
1 changed files with 20 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue