summaryrefslogtreecommitdiff
path: root/test/coverage.c
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2015-03-26 17:36:16 +0100
committerAndrea Canciani <ranma42@gmail.com>2015-04-08 14:32:17 +0200
commit654b4a8efe579b05e60c0bd0b7722d474366b1cc (patch)
treed385135718d1dfdc94bbe05dedd9eff063543c0d /test/coverage.c
parent2cf2d8e340a325adb205baf8e4bd64e1d1858008 (diff)
downloadcairo-654b4a8efe579b05e60c0bd0b7722d474366b1cc.tar.gz
test: Fix coverage-intersecting-triangles reference
Commit 4e3ef57bc892b0b046c486390adc7164a1de64de added coverage-intersecting-triangles with an incorrect reference and generator. The test checks the rasterization of two overlapping triangles in the following position: . . |\ /| | X | |/ \| .---. Since the triangles have both vertical and horizontal sides of size x/WIDTH, the expected coverage is 3/4 (75%) of (x/WIDTH)^2. The original code, instead, was checking for a coverage of 0.75*x/WIDTH, as if one of the sides was always 1 unit long. The image and xlib backends still suffer from some jitter, caused by the approximation of the actual coverage by means of sampling. For this reason their references are still considered XFAIL, even though their result now looks mostly consistent with the expected reference.
Diffstat (limited to 'test/coverage.c')
-rw-r--r--test/coverage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/coverage.c b/test/coverage.c
index 12225c325..86216df31 100644
--- a/test/coverage.c
+++ b/test/coverage.c
@@ -203,7 +203,7 @@ intersecting_triangles (cairo_t *cr, int width, int height)
#if GENERATE_REFERENCE
for (x = 0; x < WIDTH; x++) {
- cairo_set_source_rgba (cr, 1, 1, 1, x * 0.75 / WIDTH);
+ cairo_set_source_rgba (cr, 1, 1, 1, x * x * 0.75 / (WIDTH * WIDTH));
cairo_rectangle (cr, x, 0, 1, HEIGHT);
cairo_fill (cr);
}