As of libsvg 2.35 calling g_type_init() is sufficient.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Add test case for https://bugs.freedesktop.org/show_bug.cgi?id=68382
Something has regressed in the recording surface. All the recording
surface based backends lose the alpha from the paint_With_alpha.
The _cairo_color_double_to_short() function converts a double
precision floating point value in the range of [0.0, 1.0] to a
uint16_t integer by dividing the [0.0, 1.0] range into 65536
equal-sized intervals and then associating each interval with an
integer.
Under the assumption that an integer i corresponds to the real value i
/ 65535.0 this algorithm introduces more error than necessary as can
be seen from the following picture showing the analogous
transformation for two-bit integers:
+-----------+-----------+-----------+-----------+
0b00 | 0b01 | 0b10 | 0b11
+-----------+-----------+-----------+-----------+
which shows that some floating point values are not converted to the
integer that would minimize the error in value that that integer
corresponds to.
Instead, this patch uses standard rounding, which makes the diagram
look like this:
+-------+---------------+---------------+-------+
0b00 | 0b01 | 0b10 | 0b11
+-------+---------------+---------------+-------+
It's clear that if the values corresponding to the given integers are
fixed, then it's not possible to decrease the resulting error by
moving any of the interval boundaries.
See this thread for more information:
http://lists.freedesktop.org/archives/cairo/2013-October/024691.html
Reference images updated:
pthread-similar.ref.png
record-paint-alpha.ref.png
record90-paint-alpha.argb32.ref
record90-paint-alpha.rgb24.ref.png
xcb-huge-image-shm.ref.png
xcb-huge-subimage.ref.png
All of these have only one-step differences to the old images.
The variable XFAIL_TESTS is not used anymore since commit e90073f7dd.
Instead, we now have special reference images that show the wrong output and the
test suite fails a test if it does not match the expected, wrong output.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The variable XFAIL_TESTS is not used anymore since commit e90073f7dd.
The description for the known failures are moved into the respective tests as
comments.
The following descriptions were dropped:
- surface-pattern-big: Didn't really explain the failure
- big-line: Test isn't failing any more
- self-intersecting: Only XFAIL on quartz, but description doesn't match this
The following tests don't have a xfail reference image and seem to fail just
because of not having a reference image at all (I kept their description for
now):
big-trap, long-lines, self-copy-overlap
Signed-off-by: Uli Schlachter <psychon@znc.in>
fmin() requires a bump to either _XOPEN_SOURCE_ >= 600 (POSIX 2004) or
c99 - which is a needless dependency for a single simple routine.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Commit f9dcd07d22 changed the way the file name is allocated and introduced
a use-after-free in doing so.
Signed-off-by: Uli Schlachter <psychon@znc.in>
As another nitpick, a comma alone is legal for separating keywords, but
most tests use a comma and a space. Update the few tests that don't,
to make this consistent.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The parser accepts spaces as separtors between keywords, so this is nit
picky. But only a minority of tests don't follow the comma convention,
so change them to be consistent.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Also update the image.arg32 reference images, since for now we're just
accepting pixman's output as truth. This fixes up several tests:
was is
Tests run: 420 420
Passed: 224 261
Failed: 195 159
Expected Failed: 0 0
Error: 0 0
Crashed: 0 0
Untested: 0 0
Total: 420 420
Thanks to psychon for finding the code error in the test.
This adds testcases for the various cairo filter options, each of which
match to corresponding pixman filters. Use the 'downscale' keyword if
invoking tests using cairo-test-suite.
The 24-pixel reference images were produced from quad-color.png using
Gimp's Scale Image command with Interpolation set to None. It is
assumed that all filters should handle a 1:4 scaling cleanly with no
antialiased blurring.
The 95-pixel reference images assume differing types of antialiasing
based on the quality level. We are using the image.argb32 output as
reference here. Potentially some other rendering algorithm could
conceivably provide better results in the future.
The 96-pixel reference images are simply copies of the original
quad-color.png file. It is assumed that 1:1 downscaling operations
should produce no visible change to the original image.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Downscaling from 96 to 24 is easy since it's an even multiple, so try
scaling by -1 pixel too.
This adds a 1:1 scaling test case as well, which should pass through the
image unchanged.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
This adds pixman-downscale.c, which tests correctness of PNG images
scaled down using pixman routines.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
This change makes several tests behave more like ps-eps.c, et al by
making them attempt to mkdir "output", and in case of trouble use "."
instead. filenames are now allocated at runtime due to this change, so
ensure the corresponding free()'s are in place as well.
This should facilitate running the test suite with a relative path
outside cairo's source tree, such as when employing the CAIRO_REF_DIR
environment variable.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
The standard location for test output is cairo/test/output. The harness
itself was updated to write automatically generated images in this
directory, however a number of tests generate their own local output
files.
This patch updates these tests to write their output into
CAIRO_TEST_OUTPUT_DIR (which defaults to cairo/test/output) as well, in
the interest of decluttering the test directory.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Tests should be placing output files in the output/ directory now,
although not all tests follow this standard practice. Drop the
"*.out.*" from .gitignore to make improper test behavior more evident.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Such as CAIRO_TEST_MODE=scale for testing application of
cairo_surface_set_device_offset.
CAIRO_TEST_MODE=similar - test rendering through similar surfaces
CAIRO_TEST_MODE=offset - test rendering with a device offset
CAIRO_TEST_MODE=scale - test rendering with a device scale
When creating a texture surface that is larger than the maximum
framebuffer or texture dimensions of the context, return a surface in
error. Previously the code failed an assertion, but this prevents an
application from easily detecting when to fall back.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This adds code to the api-special-cases test which also tests the behavior of
cairo when the cairo context or the surface that is target is in an error state
or finished. These new tests call into all public entry points defined in
cairo.h which receive a cairo_t * as their first argument.
Currently this causes a new crash in the testsuite:
cairo-surface.c:394:
_cairo_surface_begin_modification: Assertion `! surface->finished' failed.
Reported-by: christophe.troestler@umons.ac.be
References: https://bugs.freedesktop.org/show_bug.cgi?id=68014
Signed-off-by: Uli Schlachter <psychon@znc.in>
Commit d7f5a1bec fixed a bug. This caused 12 new test failures for the
test-traps test target:
caps-tails-curve degenerate-arc degenerate-path joins subsurface
subsurface-scale twin twin-antialias-gray twin-antialias-mixed
twin-antialias-none twin-antialias-subpixel user-font
Most of these are indeed (new?) bugs. However, caps-tails-curve actually started
producing the expected result and the reference image just wrongly captures the
old state of things.
At the time of that commit, just taking the output from test-traps as the new
reference image works fine for all backends. However, with current git,
something introduced more antialiasing noise and now test-traps changed again
while cairo-xcb stayed with the old result. Thus, we also need a new reference
image to fix this test.
(The wrong reference images come from commit 8488ae02 which turned test-traps'
results into reference images)
Signed-off-by: Uli Schlachter <psychon@znc.in>
Where a content specific reference image exists, prefer to have both
content reference images (i.e. both argb32.ref and rgb24.ref) rather
than a mix of .ref and argb32/rgb24.
Courtesy of the improved check-ref-dups written by Bryce Harrington:
Running make check on the codebase (with default configuration) with the
redundant images removed produces essentially the same test results:
Before
------
Tests run: 13687
Passed: 9216
Failed: 3566
Expected Failed: 312
Error: 1
Crashed: 17
Untested: 575
Total: 13687
After
-----
Tests run: 13689
Passed: 9216
Failed: 3566
Expected Failed: 312
Error: 1
Crashed: 19
Untested: 575
Total: 13689
(with the exception being the pthread tests misbehaving between runs)
These tests use reference images somewhat differently from other tests,
so treat them as special cases and avoid recommending deleting any of
their files.
Add TODO's to each test to rework them to be more consistent with other
tests.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
perceptualdiff.c:55:19: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
perceptualdiff.c:60:16: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
The current sha1sum-based file checker does a blanket comparison of all
files with each other, which is fast but not directly helpful since it
doesn't distinguish between sibling files (which are allowable to be
duplicates). Also, it ignores files that may have byte differences
(such as PNG header differences) but are otherwise pixel-identical.
This patch replaces the sha1sum-based checker with one that accounts for
the default fallback path and uses perceptualdiff to compare files that
are bytewise different and verify whether they actually are different.
The intention is that the output of this command can be directly used to
remove redundant files, e.g.:
cd test
make check-ref-dups | cut -d' ' -f2 | \
while read f; do git rm "reference/$f"; done
This should have no impact on make check's results (modulo any tests
that behave erratically), and will help trim down the size of the
tarball.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
[ickle: rebase and add the suggested command to the Makefile]
cmp runs faster than perceptualdiff, and catches files that are exact
copies of the reference image. We still use perceptualdiff for catching
files that aren't bytewise identical, but are still identical at the
pixel level.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
This script requires the perceptualdiff program, which can be built as
follows:
cd test/pdiff && make perceptualdiff
The script's output provides a list of target-specific or
format-specific images that are identical to their more generic
reference files, and thus are redundant and can be safely removed from
the archive without altering any test behaviors.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
[ickle: applied Behdad's suggestion of renaming the script check-refs.sh]
The check-ref-dups target in Makefile.am was not updated with the new
path when the reference images were moved from test/ to
test/reference/. Now it produces output properly again.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
When we refine geometry, we do so to a tolerance as specified by the
user. This means that we can not expect tessellated results to have
exact results, but always they should match within the specified
tolerance.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Triggers the following warning during build:
sample.c:61:1: warning: ‘horizontal’ defined but not used
[-Wunused-function]
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Ever since the test output was moved from test/ to test/output/, using
CAIRO_REF_DIR to make the test suite succeed no longer works. The test suite was
looking for the wrong file names.
This patch makes this work again. However, I am not sure that this really is the
correct fix. It just seems to work. :-)
Reported-by: Darxus <darxus@chaosreigns.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
A side effect of
commit c986a7310b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Jan 24 08:55:54 2013 +0000
image: Enable inplace compositing with opacities for general routines
is that we should in theory be reducing the rounding errors when
compositing coverage.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>