This demonstrates an error in cairo where miter joins are replaced with
bevels at high scale factors due to a test added to eliminate wild miters
drawn when the line faces are nearly parallel.
cairo_get_target() returns the original surface passed to
cairo_create(), and not the current destination as required when
testing drawing to the same surface using multiple contexts.
For completeness we also use the group target when creating similar
surfaces within the tests (to check that similar surfaces of similar
surfaces also work).
To correctly copy a surface onto the destination irrespective of its
content requires the SOURCE operator. Forgetting to do so here causes
uninitialized pixels to be mixed into the result and the failure of
many tests for the similar surface. Oops...
Boris Zbarsky reported a bug where having zero stops in a
gradient pattern would crash in the quartz surface. This
test checks for that case. Mozilla bug#407104.
This also crashes testing pdf; and the ps, svg surfaces
look suspicious (they reference stops[0]) but I havent
been able to test them yet.
When emitting combined stroke and fill, cairo SVG backend was using the opacity
two times, instead of using fill-opacity and stroke-opacity, leading to
incorrect output.
I've updated the mask test reference images for the SVG output, since it seems
there's a bug in librsvg when fill-opacity is used in the mask image.
I've checked the SVG output with batik, and it looks fine.
Allow using a previous test output directory as a source of
reference images. To make use of this, set the environment
variable 'CAIRO_REF_DIR' to point at an old test directory,
relative to the current test directory.
This is useful for testing backends when reference images haven't
been created yet, or which the current reference image structure
can't accomodate, like multiple font backends.
The generated test html guesses the names of the reference
images used in the tests. This is quite often wrong, and
makes it harder to change policy in cairo-test. Teach
make-html.pl to parse the log for the path to the reference image.
The test logs currently do not record the paths of
image output, the reference images tested against, and
the diffs created. This means that make-html.pl has to
duplicate the policy in cairo-test.c. Fix this by teaching
cairo-test.c to log the paths.
https://bugs.freedesktop.org/show_bug.cgi?id=13084 demonstrates a
regression where the clip is ignored by the xlib backend whilst
rendering text. Therefore we extend the current test cases to combine
a clip that represents everything clipped out with the rendering of
text. For completeness, we add a new test case that exactly mimics the
sequence of cairo operations that lead to the discovery of this bug -
namely the rendering of text with an empty clip path.
Otherwise, these don't get included in the generated tar file
and the test suite doesn't pass when run from that tar file,
(like 'make distcheck' tests).
The patch to repeat tests for similar surfaces changed the
format of the test log files, which were parsed to produce
index.html. This fixes the parser to understand those changes.
Having noticed strange discrepancies creeping into similar surfaces
whilst working on the xlib backend, I thought it wise to also run
the test harness against similar targets. For consistency, only
targets whose similar surface use the same backend are included.
This can be disabled by exporting CAIRO_TEST_IGNORE_SIMILAR=1.
The Laplacian pyramid can only work on images larger than 3x3 due to the
size of its convolution kernel. So if the image is too small return an
error (-1) before attempting to construction the pyramid.
Andrew Jorgensen spotted that make dist was missing a few headers needed
for compilation and running make distcheck had spurious failures. Add
the missing files to the distribution and a silly one-liner to check for
missing reference images.
As we now generate empty paths, we must be able to handle empty paths
in the user facing API. cairo_append_path() has an explicit check, and
raises an error, for a NULL path->data, so we need to check the
path->num_data first for empty paths.
Generate a real empty path structure instead of returning
_cairo_path_nil, if we have been asked to create an empty path.
(Also add a couple of missing _cairo_error()s and an appropriate test
case.)
Spotted by Fred Kiefer.
Moments after pushing the new test case did I realise the issue...
We do not attempt to write out the surface to the user stream until
we perform the cairo_surface_destroy() by which point we have lost
the ability to interrogate the error status. We can avoid this by
explicitly calling cairo_surface_finish() and then checking the
error status - and we see that the error is indeed reported
correctly.
No bug. Nothing to see here. Please move along. (Apart from the
request for the status to be return from cairo_surface_destroy!)
From bug https://bugs.freedesktop.org/show_bug.cgi?id=7049, we find
that the error status from the user supplied write function to
cairo_*_surface_create_for_stream is ignored and not propagated back
to the surface/context - leading to silent data loss. Incorporate
the suggested test case, a write function that simply returns
CAIRO_STATUS_WRITE_ERROR, into create-for-stream.c.
Use the png_struct->error_ptr to propagate the error status from the
user/stdio read and write functions through the png_error() to the
cairo_surface_write_to_png*() and cairo_surface_read_from_png*()
functions. From there the error is returned back to the user either
directly or as the most appropriate error surface.
(Fixes https://bugs.freedesktop.org/show_bug.cgi?id=6909)