This ensures that error due to double-to-float conversion
does not accumulate; the position of any glyph will be off by
at most one double-to-float conversion error.
Previously, a failure in _cairo_win32_scaled_font_init_glyph_path leading
to the CLEANUP_FONT label would set the path into the glyph, then destroy
the path, and return an error status, (which in turn would cause a double
free when the glyph was destroyed).
The double-free apparently leads to a crash in some cases, as described
here:
SVG/Cairo related crash when opening specific webpage
https://bugzilla.mozilla.org/show_bug.cgi?id=376498
This should eliminate the double-free, but does not address the original
error case, (attempting to get a path from a bitmap font?).
This is necessary to avoid many portability problems as cairoint.h includes
config.h. Without a test, we will regress again, hence add it.
The inclusion idiom for cairo now is:
#include "cairoint.h"
#include "cairo-something.h"
#include "cairo-anotherthing-private.h"
#include <some-library.h>
#include <other-library/other-file.h>
Moreover, some standard headers files are included from cairoint.h and need
not be included again.
Quartz and Xlib both define Picture and Cursor, and clashed in
cairo-boilerplate.c. Splitting quartz out allows a single mac
build with --enable-quartz --enable-atsui.
Previously, the convention was that static ones started with cairo_, but
renamed to start with _cairo_ when they were needed from other files and
became cairo_private instead of static...
This is error prune indeed, and two symbols were already violating. Now
all nil objects start with _cairo_.
The reference image is no longer the correct size, so isn't
providing a comparison at all. In the absence of a better
replacement, removing it at least gives us diffs.
Frequently cairo_set_source_rgb[a]() is used to replace the current
solid-pattern source with a new one of a different colour. The current
pattern is very likely to be unshared and unmodified and so it is likely
just to be immediately freed [or rather simply moved to recently freed
cache]. However as the last active pattern it is likely to cache-warm and
suitable to satisfy the forthcoming allocation. So by setting the current
pattern to 'none' we can move the pattern to the freed list before we
create the new pattern and hopefully immediately reuse it.
Unfortunately one cannot cache live patterns and return a fresh reference
instead of creating new ones as patterns can be modified by the user and
so cannot be transparently shared between different users. However,
solid colour allocation is still a frequent operation, so we maintain a
small cache of recently freed patterns to reduce the malloc pressure.