A cleared surface is needed when playing back a recording surface that
has semi-transparent operations.
As this only affects surface types where scratch surfaces aren't already
cleared (ie it affected xlib but not image), the effect was only visible
for those backends.
This should not cause any performance regressions as the other backends
set surface->clear = TRUE when creating the scratch surface, so the
clear operation is effectively a no-op.
Covered by the existing pdf-surface-source and svg-surface-source tests.
This reverts commit 5fc04bba9f.
Whilst this fixes the self-referential reference leak, it however
introduces use-after-finish into normal behaviour. Close, but not quite.
User paranoia - as the replay is exposed to the user it is convenient to
add the finish check in the core replay function so that we gain a
paranoia check for the internal paths as well.
Carefully handle subsurfaces of a recording surface through the analysis
and paginated surfaces so that we can generate a native pattern for the
vector backends, demonstrated by the PostScript backend.
Nothing remarkable, just a lot of bookkeeping to track the wrapped
surface types and to apply the correct offsets when generating the
subsurface pattern.
During show_page() when we destroy the recording surface after emitting
the page, ensure that we actually call cairo_surface_finish() to dispose
of any self-referential reference leaks.
Cache the result of snapshotting using the backend vfunc in the normal
manner by attaching the snapshot to the target. This should reduce
resource usage in these cases.
After a renewed discussion, it was pointed out that the API in Cairo was
not restrictive and by using doubles we would be consisted with the rest
of the API. Thus prompting the name change to
cairo_surface_create_for_rectangle()
similar to cairo_rectangle().
And document the public API.
In the XCopyArea region code, don't modify src_x/y when they are later
used in the unbounded fixup code.
Exposed by composite-integer-translate-source test.
The extents clip regions that were created for unbounded operators were
not translated properly. This has been changed now.
This is a followup to 9ce8bef9d6.
_atomic_fetch() was expected to replace the content of a slot with
NULL and return the old content, but it incorrectly returned the
previous content even if it was unable to perform the exchange
(because of conflicts with other threads accessing the pool).
Fix suggested by Chris Wilson <chris@chris-wilson.co.uk>
Some implementations only offer one version of compare-and-exchange,
thus we expose both through cairo-atomic, implementing what is missing
through appropriate fallbacks.
*_cmpxchg() now return a boolean (this unbreaks _cairo_atomic_uint_cmpxchg)
*_cmpxchg_return_old() return the old value
Code is updated everywhere to reflect this, by using *_cmpxchg()
wherever the returned value was only tested to check if the exchange
had really taken place.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
_cairo_atomic_int_set() was only used in the definition of
CAIRO_REFERENCE_SET_VALUE, which was never used.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Otherwise unbounded operators will clear the full surface.
Improves the score for the unbounded-operator test, in particular the
output for the test-fallback case.