In converting to cairo_list_t, it helps to preserve the semantics of
appending the page to the end of the list where it is expected to be
plucked in the event of an allocation failure.
The function takes a cairo_device_t argument as it can be called on an
unacquired device.
This is the first patch in a process to try to rid cairo-gl-surface.c of
casts from cairo_device_t to cairo_gl_context_t. As its members should
usually only be accessed when the device is locked, the only way the
cairo_gl_context_t should be acquired is using
_cairo_gl_context_acquire().
cairo-clip.c: In function ‘_cairo_clip_path_reapply_clip_path_translate’:
cairo-clip.c:446: warning: suggest parentheses around assignment used as
truth value
Short-term solution to avoid the refleaks and to make the test suite
happy. A more elegant solution would be to track the references and
avoid the substantial memory overhead of copying the recording surfaces.
Thanks to Benjamin Otte for pointing out the solution to avoiding
refcycles.
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.