This was an initial attempt to fix the infinite loop bug
described here:
Infinite loop when scaling very small values using 24.8
http://bugs.freedesktop.org/show_bug.cgi?id=14280
This doesn't actually fix that bug, but having a more robust
comparison function can only be a good thing.
Remember to destroy the sub_font if we fail to reserve the .notdef glyph
during construction.
Whilst in the vicinity, adjust the function prototype to remove
duplicated calls to _cairo_error().
The PDF backend has always used "\r\n" for the newline character.
There was no particular reason for this choice. PDF allows "\n", "\r",
or "\r\n" as the end of line marker.
Since the PS backend (which uses "\n") has started sharing
cairo-pdf-operators.c with the PDF backend, the PS output has been
getting mixed "\n" and "\r\n" newlines.
Fix this by changing the PDF backend to use "\n".
The optimization to avoid sqrt() for horizontal/vertical lines in
_compute_normalized_device_slope was causing us to return a negative
magnitude with a positive slope for left-to-right and bottom-to-top
lines, instead of always returning a positive magnitude and a slope
with an appropriate sign.
Minor correction for a build failure on AIX:
"mozilla/gfx/cairo/cairo/src/cairo-gstate.c", line 45.43: 1506-294 (S)
Syntax error in expression on #if directive.
(Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=415867.)
In order to correctly report the error back to the user during the
creation of a scaled font, we need to support a nil object per error.
Instead of statically allocating all possible errors, lazily allocate
the nil object the first time we need to report a particular error.
This fixes the misreporting of an INVALID_MATRIX or NULL_POINTER that
are common user errors during the construction of a scaled font.
Partial revert of commit 0086db893c.
This is a follow to the earlier commit that allowed creation of scaled
fonts using a NULL font options (by interpreting the NULL as meaning
use the default options) to reflect the comments made by Behdad
(http://lists.cairographics.org/archives/cairo/2008-January/012714.html).
The intent is that the public font options getter/setter API has similar
defensive behaviour to that of the core objects - i.e. do not overwrite
the nil object and if the object is in error then return the default
value. For the indirect use of a NULL/nil font options (e.g. creation of
scaled fonts), then an error should be returned rather than crashing.
Inspired by bug 7362 (painting a glitz surface onto an xlib surface
crashes cairo) and the lack of coverage for
_cairo_paginated_surface_acquire_source_image(), these tests attempt
to use each backend as a source surface for all the other backends.
For example, this checks that one can construct a PS file ready for
printing and then copy that surface to an image/xlib for previewing.
Only translate an UNSUPPORTED error into a SURFACE_TYPE_MISMATCH, all
others can be returned to the user unadulterated.
PNG doesn't support width==0 or height==0 and generates an error
whilst writing - which without further information is assumed to be
a NO_MEMORY error. So check the image size at the start and return a
WRITE_ERROR for a zero sized image.
Ensure the win32-printing surface has the same fixes for meta surface
patterns with more than one level of push/pop group that PS/PDF
received in 060f384310
When the emitted image is not inside a PS procedure we can use the
currentfile operator as the datasource instead of an array of strings.
This avoids having to read to entire image data into printer memory
before the image can be decoded. This improves the performance and
reduces the chance of running out of memory on printers with limited
memory.
To be able to use the currentfile operator we need to combine the
image data and mask data into the one data source. InterleaveType 2
scan line interleaves the image and data.
_ps_surface_fill() can also avoid using PS patterns for EXTEND_NONE
surface patterns. A clip path is set around the fill path then the
surface is painted.