Use _cairo_pattern_create_copy()/cairo_pattern_destroy() instead of
_cairo_pattern_init_copy()/_cairo_pattern_fini() so the PDF backend
can reference the patterns and destroy them later.
This code is never used because outline glyphs that go through the
fallback path are always embedded with Type 1 fallback. The only fonts
that are embedded as Type 3 are bitmap fonts.
After using fopen() and friends check the global errno to determine the
most appropriate error return - especially important when running
memfault, where correct reporting of NO_MEMORY errors is required.
Previously, _cairo_traps_extents () returned the extents
p1={INT_MAX, INT_MAX} p2={INT_MIN, INT_MIN} for an empty traps leading
to integer overflow when computing the width using p2-p1 and causing
further overflows within libpixman. [For example this caused the
allocation of massive regions with test/mask and the PS backend.]
&image_extra was being passed instead of image_extra to release; the
bug only manifested itself when the particular backend did something
with image_extra.
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.
Do not return after encountering the first error whilst closing streams,
but continue to close any auxiliary streams before finally reporting the
error. Also during finalize check that we have closed any streams that
may have been left open after encountering an error.
Test for an invalid matrix before use. Whilst this has no effect on the
result, an INVALID_MATRIX error will be raised on the context, placing
the guards first makes the code obviously safe and avoids manipulation
of invalid matrices.
This was failing with more than one level of push/pop group. The
problem was that the meta surface replay in PS/PDF emit_meta_surface
was replaying all the meta surface commands insteads of only the
natively supported commands. The analysis surface has also been
changed to replay meta surface patterns back to the one analysis
surface instead of creating a separate analysis surface for each
pattern. The analysis surface now transforms bounding boxes with the
meta surface pattern matrix so that fallback regions are correctly
tracked.
Bug report and proposed patch at:
http://lists.cairographics.org/archives/cairo/2007-December/012529.html
On Windows the tmpfile() function creates the file in the root
directory. This will fail if the user does not have write access to the
root directory.
Implement _cairo_win32_tmpfile() that is #defined as tmpfile() on
Windows. This function uses GetTempPath() and GetTempFileName() to
create the temporary file. CreateFile() is used to open the file so
the DELETE_ON_CLOSE flag can be set.
By enlarging buf_size to ensure the correct alignment of the points
array with the cairo_path_buf_t block, we can efficiently use the
padding bytes to store more ops.
In http://bugs.gentoo.org/show_bug.cgi?id=203282, it was identified that
the cairo_path_buf was causing unaligned accesses (thus generating SIGBUS
on architectures like the SPARC) to its array of points. As we manually
allocate a single block of memory for the cairo_path_buf_t and its
arrays, we must also manually ensure correct alignment - as opposed to
cairo_path_buf_fixed_t for which the compiler automatically aligns the
embedded arrays.
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).
If the backend does not support fallbacks ie backend->acquire_dest_image
or backend->acquire_source_image is NULL, then return
CAIRO_INT_STATUS_UNSUPPORTED rather than attempt to jump to the NULL
hooks.
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...
Avoid returning uninitialized variables if we're asked to find the
bounds of an empty path - in which case we just return a rectangle
of zero width and height similar to the empty clip region.