[cairo-commit] test/coverage.c

Chris Wilson ickle at kemper.freedesktop.org
Sat Jun 12 07:14:48 PDT 2010


 test/coverage.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

New commits:
commit 968374b6335199cbf02c8c4733537388da2a45f5
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jun 12 15:14:17 2010 +0100

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

diff --git a/test/coverage.c b/test/coverage.c
index d77b1e3..c2dd398 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);


More information about the cairo-commit mailing list