cairo-gstate applies the ctm to the coordinates used in paths,
but not to the line width. In quartz this ends up drawing unscaled
lines. This is a minimal fix - it undoes the scaling applied to the
points and then draws the path scaled correctly.
Implement extend-none for surface patterns, by using a single
DrawImage where possible. There is some code duplication in this
patch, to make it easier to edit this patch series without conflicts.
A patch to remove duplicate code will be required later..
Attempt to allocate the edges during tessellate_polygon() from the stack,
if the polygon size is sufficiently small and amalgamate the separate
allocations for the list of events and their sorted index into a single
block.
Behdad Esfahbod noted that in ff5af0f540 I had introduce new error
paths without the appropriate _cairo_error(). So review cairo-ft-font
to ensure that _cairo_error() is called at the start of every error path,
as close to the originating error as possible.
Set the cairo_t status to be the surface->status when the context is
created, and special case the NO_MEMORY status in order to avoid a
redundant allocation.
After using the public API to access the scaled font, which only sets
the status field in the font, check the scaled font status. This will
then correctly propagate errors during glyph loading to the context.
Add an initial guard in _cairo_gstate_ensure_scaled_font() and
_cairo_gstate_ensure_font_face() to check that there is no prior
error status on the objects.
After introducing a work queue for deferred destruction of X resource
my firefox crashes over and over again because XRenderFreeGlyphs is trying
to free a non-exist glyph (already freed). The problematic call sequence is
something like below:
XRenderAddGlyphs (20990204, 20069)
XRenderAddGlyphs (20990204, 20069)
XRenderFreeGlyphs (20990204, 20069)
XRenderFreeGlyphs (20990204, 20069)
You can see the two add/free glyphs is interlaced. And obviously, we'll crash
at the last one. To fix this bug, we must be ensure here's no pending work
to free the glyph that we want to sent.
I don't know how I managed to get glyph measurement so badly wrong
before, but tracing paths was not necessary, and 6x slower. The fix
switches to using ATSGlyphGetScreenMetrics for all metrics, and remove
the old measuring code.
_cairo_pattern_fini depends on the pattern being correctly initialised,
for example when calling _cairo_user_data_array_fini(), so we need to
initialize the whole pattern and not just set the type to SOLID when
creating a pattern for a surface in error.
The image surface that _cairo_quartz_surface_acquire_source_image creates never
seems to be released, probably because there is no release_source_image callback
in the quartz code.
The attached patch fixes that problem, at least insofar as the image surface
itself is no longer leaking. I'm not sure whether any other cleanup needs to
happen here.
-Boris
Previously if the backend finish() function returned an error status,
surface->finished was not set true. This would result in the backend
finish() function being called twice which in the case of the PostScript
backend caused a seg fault.
_cairo_pdf_surface_emit_pattern_stops() tried to set the last element
to have an offset of exactly 1.0, but missed and set the next element
after the end of the array.
cairo_surface_create_similar() does not return NULL as was being checked
for, but the nil surface on error. Also ensure that the returned surface
is destroyed if we encounter an error whilst compositing.