[cairo-commit] test/coverage.c test/reference
Andrea Canciani
ranma42 at kemper.freedesktop.org
Wed Apr 8 05:36:33 PDT 2015
dev/null |binary
test/coverage.c | 2 +-
test/reference/coverage-intersecting-triangles.image.xfail.png |binary
test/reference/coverage-intersecting-triangles.ref.png |binary
4 files changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 654b4a8efe579b05e60c0bd0b7722d474366b1cc
Author: Andrea Canciani <ranma42 at gmail.com>
Date: Thu Mar 26 17:36:16 2015 +0100
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.
diff --git a/test/coverage.c b/test/coverage.c
index 12225c3..86216df 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.image.xfail.png b/test/reference/coverage-intersecting-triangles.image.xfail.png
new file mode 100644
index 0000000..c0290e4
Binary files /dev/null and b/test/reference/coverage-intersecting-triangles.image.xfail.png differ
diff --git a/test/reference/coverage-intersecting-triangles.ref.png b/test/reference/coverage-intersecting-triangles.ref.png
index 40a48c1..adf93db 100644
Binary files a/test/reference/coverage-intersecting-triangles.ref.png and b/test/reference/coverage-intersecting-triangles.ref.png differ
diff --git a/test/reference/coverage-intersecting-triangles.xfail.png b/test/reference/coverage-intersecting-triangles.xfail.png
deleted file mode 100644
index c0290e4..0000000
Binary files a/test/reference/coverage-intersecting-triangles.xfail.png and /dev/null differ
More information about the cairo-commit
mailing list