_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.
Provide a hook for the test to be able to compute the number of ops per
second. For instance, the glyphs test uses it to report the number of
kiloglyph per second Cairo is able to render.
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.
During finish, if we encountered an error during the construction of the
surface, simply proceed to cleanup rather than emit the incomplete and
potentially subtly broken output.
In the event of an empty bounded rectangle, the computation of the
unbounded - bounded rectangles leads to negative areas, integer overflow
and death.
[And similarly for the derived surfaces.]
Ensure that the error status from patterns is propagated when used by
doing so in the surface layer. Similarly check that a surface pattern
has not been finished.
When compiling we can depend on whatever version of cairo we need, but
we should be wary of checking for runtime compatibility when building
standalone.