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.
The make-cairo-test-constructors.sh script executes several commands
without checking their success. This can lead to undetected errors,
like those fixed in 86fad78fcd.
The script now exits with an error status if no file is
input. Moreover, it sets the '-e' flag, so that if a command fails,
the whole script is immediately terminated with an error.
In the Makefile.am, the script result is now checked and the target
file is removed upon error. This ensures that the
'cairo-test-constructors.c' target completes succesfully only if no
error occurred.
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
files. Because of this, the generated cairo-test-constructor only
contained a few tests and the test suite was thus incomplete.
Original patch by Andrea Canciani <ranma42@gmail.com>
When running the cairo-test-suite, valgrind reports each of the
registered test as a leak, because they are _list_prepend()'ed, but
the tests list is never _list_free()'d.
Fixes the following valgrind error:
malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
cairo_boilerplate_xmalloc (cairo-boilerplate-system.c:47)
cairo_test_register (cairo-test-runner.c:131)
_cairo_test_runner_register_tests (cairo-test-constructors.c:1112)
main (cairo-test-runner.c:714)
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
The pattern created by cairo_pattern_create_rgb() is owned by the
caller, hence it needs to be released.
Fixes the following valgrind error:
malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
_cairo_pattern_create_solid (cairo-pattern.c:605)
_cairo_pattern_create_in_error (cairo-pattern.c:628)
cairo_pop_group (cairo.c:552)
test_cairo_push_group (api-special-cases.c:157)
preamble (api-special-cases.c:1766)
main (cairo-test-runner.c:228)
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
These two images are mis-rendered (clearly evident from visual
inspection). By removing them, the test will fall back to the more
general format-specific images, huge-radial.argb32.ref.png and
huge-radial.rgb24.ref.png.
Note that the huge-radial.pdf tests still fail to pass, but the pdiff
looks more sensible.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66218
Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
The pixman downscaling "95" tests attempt to rescale a 96x96 pixmap to
95x95. Ideally the borders between color areas should be sharp, but for
this use case we allow for 1 pixel of blur between the areas as
acceptable. The choice of what color to use for this blurred region is
not important, and in fact varies from backend to backend.
The old reference images were generated by Krzysztof Kosiński's
downscaling algorithm. These new images are against the algorithms
written by Bill Spitzak.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
There are cases where the rendered output of a test can vary from
backend to backend in ways which are visually acceptable. This is why
we have reference images in the first place. In these cases, changes to
the rendering logic can result in slight differences in the output that
is also within acceptable visual limits.
We see this in the pixman downscaling tests. This script is introduced
as a way to more easily update the reference images after a renderer
change.
This script is intended to be expanded to handle updating of references
for other tests as we identify similar issues. The intent is that this
script then serves as a way to document these exceptional cases.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
When investing the symmetry of the raterisation, we want to have a
simple replay of all of the original geometry through a the flipped
recording surface. This reduces the worry about artifacts from the
clipped rendering.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(And include a git add missed from commit
ccd48b3464
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Sep 30 14:06:21 2014 +0100
test: Remove more duplicated reference images
but were mostly invalidated by the rasteriser changes anyway).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In order to check the behaviour of the analytic rasteriser inside tor,
let's compare it against a very simple rasteriser that uses a rectiliner
256x256 sample grid.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Using CAIRO_OPERATOR_OVER in case causes oversampling of the coincident
edges, to measure coverage we should only use ADD. :|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When updating the quorem between cells, we would lose the overflow
increment as it was only applied locally and not preserved by updating
the quorem.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Currently coverage is marked as slow. It is slower than the typical
test, but it is quite a useful check on our rasterisation quality
without going too far overboard (unlike partial-coverage!).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The goal is to preserve the precision in the gradients of the edges and
only apply the projection into the final cell location. We also include
the half-subrow offset as spotted by Massimo.
References: https://bugs.freedesktop.org/show_bug.cgi?id=84396
Testcase: coverage-rhombus
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we have both a argb32 and rgb24 reference image that are identical,
we can replace them with a plain reference image. I also prefer to have
argb32/rgb24 versions of the reference images if rgb24 differs from the
plain reference.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Massimo noticed that the record/record-flip were not being rasterised as
identical mirror images due to a half-subpixel offset in the tor scan
converter. This test attempts to reproduce this error by rendering a
rhombus around the origin of each cell (that is it generates 4 mirror
images of a triangle in the 4 different orientations0. The expectation
is that each pixel in the group is lit identically as the coverage is
identical.
References: https://bugs.freedesktop.org/show_bug.cgi?id=84396
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This test exercises error scenario when creating over sized egl surface
that is larger than maximum framebuffer or texture dimensions of the
context
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
cppcheck analysis tool reports the following issues when run on the
latest Cairo source.
$ grep "(error)" cppcheck_error_log.txt
[test/pdf-mime-data.c:58]: (error) Possible null pointer dereference: file - otherwise it is redundant to check if file is null at line 53
[test/pdf-mime-data.c:75]: (error) Resource leak: fp
$
The proposed changes fixes the above issues.
And also it does some refactoring to print the appropriate error messages
for each error condition in read_file() function and also to free the allocated
data buffer.
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reformatted the README file to simplify the sentences.
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Added a new command line option FORMAT which can take rgb and/or rgba
values which enables the execution of tests only for the given FORMAT
For ex:
(1). CAIRO_TESTS="zero-alpha" make test TARGETS=ps2,image FORMAT=rgba,rgb
This command runs the zero-alpha test for both ps2 and image backends
with argb32 and rgb24 content formats.
(2). CAIRO_TESTS="zero-alpha" make test TARGETS=ps2,image FORMAT=rgba
This command runs the zero-alpha test for both ps2 and image backends
with argb32 content format and so on.
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Though --enable-pdf=yes by default, when --enable-pdf=no, the cairo build
fails due to unavailability of cairo-pdf.h and related cairo pdf's apis.
The current changes fixes this issue by conditionally checking if PDF
surface is enabled or not.
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
The test program any2ppm can run as daemon. This feature can be disabled
at compile time, if the required headers are not present. However the
support for fork() is not checked.
This patch fixes this issue.
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
xcalloc is a wrapper for calloc. If it can't allocate memory then it
terminates the program. The current changes replace the usages of calloc
by xcalloc in tests.
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
ARRAY_LENGTH macro is used in perf's cairo-perf.h, src's cairoint.h,
test's cairo-test.h and in some internal header files of util's
directory.So to maintain consistency ARRAY_SIZE is replaced with
ARRAY_LENGTH macro.
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
These reference images are generated by the new GENERATE_REFERENCE mode that the
previous commit introduced.
I have no idea what the "base" images. From my reading of the code in
boilerplate/, these images will be used by the test-XXX targets. However, these
seem to generate the same result than e.g. the image backend. Thus, I deleted
these files.
There is still pthread-same-source.quartz.xfail.png. This file was created in
commit b6e16b8d and touched in commit 5a1e590b1. No idea if this is still valid
and since I don't have a Mac, I won't touch it.
The test is still broken on the following backends (out of the backends I have
compiled in). This mostly seems to be differences in image scaling, but I
couldn't figure out an easy way to tell the test suite that the new results are
correct.
test-paginated, ps2, ps3, xcb, xcb-window, xcb-window&, xcb-fallback, xlib,
xlib-window, xlib-fallback, recording
Signed-off-by: Uli Schlachter <psychon@znc.in>
When the new GENERATE_REFERENCE symbol is defined to 1, no threads are involved
at all. In this case, all operations are done sequentially by the main thread.
Thus, in this mode no thread issues can occur and the result must be usable as
reference images.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
The g_type_init() routine was deprecated in glib 2.34. Tested and
verified this conditionalization on glib 2.32 and 2.36. No need to
change version dependencies.
test/any2ppm.c:864:5: warning: ‘g_type_init’ is deprecated
(declared at /usr/include/glib-2.0/gobject/gtype.h:669)
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This silences a warning due to header file deprecated as of libsrvg
2.36.2. Tested and verified this hackaround on librsvg 2.36.4 and
2.36.1. No need to change version dependencies.
In file included from test/any2ppm.c:73:0:
/usr/include/librsvg-2.0/librsvg/rsvg-cairo.h:27:2: warning:
#warning "Including <librsvg/rsvg-cairo.h> directly is deprecated."
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Most likely this is just a theoretical problem since we just checked
feof, but this quells the following warning:
ps-eps.c:216:8: warning: ignoring return value of ‘fgets’, declared with
attribute warn_unused_result [-Wunused-result]
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>