diff options
author | Andrea Canciani <ranma42@gmail.com> | 2015-03-26 17:36:16 +0100 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2015-04-08 14:32:17 +0200 |
commit | 654b4a8efe579b05e60c0bd0b7722d474366b1cc (patch) | |
tree | d385135718d1dfdc94bbe05dedd9eff063543c0d /test | |
parent | 2cf2d8e340a325adb205baf8e4bd64e1d1858008 (diff) |
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')
-rw-r--r-- | test/coverage.c | 2 | ||||
-rw-r--r-- | test/reference/coverage-intersecting-triangles.image.xfail.png (renamed from test/reference/coverage-intersecting-triangles.xfail.png) | bin | 14444 -> 14444 bytes | |||
-rw-r--r-- | test/reference/coverage-intersecting-triangles.ref.png | bin | 209 -> 262 bytes |
3 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); } diff --git a/test/reference/coverage-intersecting-triangles.xfail.png b/test/reference/coverage-intersecting-triangles.image.xfail.png Binary files differindex c0290e492..c0290e492 100644 --- a/test/reference/coverage-intersecting-triangles.xfail.png +++ b/test/reference/coverage-intersecting-triangles.image.xfail.png diff --git a/test/reference/coverage-intersecting-triangles.ref.png b/test/reference/coverage-intersecting-triangles.ref.png Binary files differindex 40a48c138..adf93dbd5 100644 --- a/test/reference/coverage-intersecting-triangles.ref.png +++ b/test/reference/coverage-intersecting-triangles.ref.png |