test: Fix coverage-intersecting-triangles reference

Commit 4e3ef57bc8 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.
This commit is contained in:
Andrea Canciani 2015-03-26 17:36:16 +01:00
parent 2cf2d8e340
commit 654b4a8efe
3 changed files with 1 additions and 1 deletions

View file

@ -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);
}

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 262 B