Andreas Falkenhahn reported a bizarre situation with some
implementations of qsort that actually compare the same elements and
require the comparator to return 0. So be it.
Reported-by: Andreas Falkenhahn <andreas@airsoftsoftwair.de>
There is no need to shrink the cache if we add an entry of size 0, so
don't by moving the guards in _cairo_cache_shrink_to_accommodate() to the
callers.
In _cairo_surface_mask() there was an invaild optimization (it failed
for surfaces without alpha content). Using _cairo_pattern_is_clear()
is the correct way to evaluate if a pattern is clear.
Fixes clear-source
Andrea found and fixed (and updated all the traces!) an endian bug where
we were encoding a 32bit length inside the compressed string stream.
However, this one inside the script backed escaped his notice.
_gradient_is_opaque() previously returned TRUE for gradient with
no stops, triggering a false optimization in _cairo_gstate_mask().
Fixes test/gradient-zero-stops-mask
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
By tracking which fields of information are already available on the
scaled_glyph we can more efficiently determine if we already have the
requested fields. This reduces from about 6 conditionals to one, and
reduces the function overhead by ~20% -- which has a measurable
improvement on glyph benchmarks.
The return is just a hint that the clip is empty, however we are about
to immediately apply the surface clip and so do not care for an
'optimised' path.
As the device is already finished, we can not lock it without raising an
error, so we have to open code the destruction of the font entries.
Fortunately we can make several simplifying assumptions about the
required cleanup as we know the device is also being destroyed.
We also need to acquire the device upon finish, similar surface creation
and the pagination functions, i.e. the other times outside of the
drawing ops that must modify the shared context/device.
As _cairo_clip_init_rectangle() is equivalent and more importantly more
clearly written as:
_cairo_clip_init(&clip);
if (status = _cairo_clip_rectangle(&clip, &rect)) {
_cairo_clip_fini(&fini);
return status;
}
perform the transformation and in the process catch a few mistakes along
error paths.
Damien Carbonne reported that cairo_device_t lacked the language binding
hooks normally associated with cairo objects. So add the missing
get_reference_count, get_user_data and set_user_data.
A fallback should never persist beyond the flush into the finish, but
yet one remains in test/clip-shapes-unaligned-rectangles. For the time
been, simply clean up the rogue surface.