This was a tiny piece of cleanup that had been erroneously included
with some earlier functional changes, (so it went through a cycle
of being applied and reverted). It's back now in its own commit.
This reverts commit 285b702ef6.
The recent commit of 0791f342b9 fixes
the same bug that 285b702e was fixing, but without introducing any
performance-killing calls to XSync. So we can drop those now.
This reverts commit 7016614dd9.
We want to avoid any negative performance impacts due to extra calls
to XSync. The fact that X errors can be missed with this appraoch is
undesirable of course---a proper fix will likely involve moving to
XCB which will hopefully allow us to do the error-checking the way
we want without any performance penalty.
This eliminates X errors propagated from cairo due to cleaning up
Render Pictures after the application had already destroyed the
Drawable they reference. (It would be nice if the X server wouldn't
complain that some cleanup work is already done, but there you
have it.)
This fix has been verified to fix the bug causing OpenOffice.org to
crash as described here:
XError on right click menus in OOo.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=243811
And unlike other proposed fixes for this bug, this fix does not
introduce any new calls to XSync, (and thereby avoids performance
concerns from those).
It is possible for the resources that we defer freeing to be already
destroyed and trigger an XError whilst processing the work queue. For
example, the application renders to a Window and then destroys the
Drawable before proceeding with more rendering. This will trigger an
invalid Picture from RenderFreePicture whilst attempting to free the
resources.
By ignoring the possibility that the application could allocate a fresh
resource with the same ID, we can simply hide the XErrors...
Fixes: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=243811
Call XSync before ignoring errors from XGetImage to avoid hiding
unassociated errors. Similarly, call XSync before reinstalling the old
error handler to ensure no errors creep out of the ignored section.
When an xlib surface is used as the source of a draw operation this
will cause the contents of child windows to be included in the source
data. The semantics of drawing to xlib surfaces are unchanged (ie:
draws are still clipped by child windows overlapping the destination
window).
[quartz] move glyph array declarations
Move declarations causing a warning. A separate patch from
the other warning cleanups because it moves where the allocation
happens.
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.