This reverts commit 2fd50a7897.
Spoke too soon, quartz doesn't like creating those 0x0
images; while the tests pass, its putting warnings in the logs.
Reverting to make a better fix.
Some tests, like invalid-matrix, generate a 0x0 bitmap; in
the quartz backend this caused a nil surface to be returned,
whereas the tests expect a quartz surface. Other surfaces
return a backend-specific surface with a zero-sized bitmap,
quartz should do the same.
Fixes the tests ft-font-create-for-ft-face, get-and-set,
get-clip, invalid-matrix, line-width-zero,
select-font-no-show-text, solid-pattern-cache-stress,
surface-finish-twice, and text-cache-crash.
All the copied data buffers except the first one weren't completely
initialized (num_ops and num_points). That was the cause of the failure
of some vector surface tests, like random-intersections.
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.
win32-glyph-metrics.patch: GetGlyphOutline only works on Truetype fonts,
so for non-Truetype fonts, assume no left or right bearing and use the
font ascent and descent for the glyph extents.
Quartz has a bug with images greater than (signed) 16 bits in height; avoid
creating or working with those. Also fixes some memory leaks.
Patch from John Daggett.
If a surface resolution is set via _cairo_surface_set_resolution, it
needs to be used when the fallback image is created. The user sets
the fallback resolution on the paginated surface, so we need
to divide that by the resolution of the actual (target) surface, not
the paginated surface.
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.
The height is currently mapped to the atsui metrics property capHeight, which
is documented as "The height of a capital letter in the font from the baseline
to the top of the letter".
That doesn't match what height is in cairo, it should be the disctance between
baselines. This patch that fixes that (and makes webkit on GTK+ OS X
layout nicely).
Whilst NEED_MEMORY_BARRIER should be a subset of ! HAS_ATOMIC_OPS,
until we have accurate configure tests NEED_MEMORY_BARRIER may be
invoked independently.
Allocate subsequent path bufs twice as large as the previous buf,
whilst still embedding a small initial buf into cairo_path_fixed_t
that handles the most frequent usage.
_cairo_surface_fill_region(): avoid allocating the array of boxes if we
know that the region only contains one box and is therefore defined by its
extents.
Add a configure check to determine whether the host cpu can read/write
cairo_atomic_t without an explicit memory barrier, and update the macros
within cairo-atomic-private.h to reflect this knowledge.
Inline and unroll PointDistanceSquaredToSegment() and eliminate the
multiple conversions between fixed point and doubles. This simple
transformation both shrinks the code and wins a few percent in path
intensive benchmarks such as fuckhergently.swf
By splitting out the knot vectors into a smaller, separate structure, we
can dramatically reduce the stack allocation for each level of recursion.
Secondly we can have the storage requirements by modifying the first set
of knots in-place, thus we need only allocate stack space for the knots
covering the deferred half of the spline.
Ensure that the output extents of cairo_scaled_font_glyph_extents(),
are zeroed if we return early due to being passed by the user a
cairo_scaled_font_t with an error set.
If libpng has not been compiled with jmpbuf support, then we cannot
atempt to use it - in which case we fall back to png's default error
handler and abort.
The previous commit increased the precision of floats from 6 digits
after the decimal point to 18 digits to correct rounding errors with
very small numbers. However most of the time this extra precision is
not required and results in increased PS/PDF output.
This commit makes the precision after the decimal point 6 significant
digits. For example:
1.234567
0.123456
0.00123456
0.00000000123456
We write floats using %f as the scientific format used by smarter %g is
invalid in PS/PDF. %f however by default rounds to five digits after
decimal point. This was causing precision loss and making the newly
added degenerate-pen test fail for PDF. We now print up to 18 digits
which is as many bits doubles can accomodate. We can be smarter, but
that's for another commit.