Use the embedded operand on the surface instead of copying it across and
trying to then wrap the surface from it - as it would then unref the
glyph cache surface after the operation and so we would lose the glyphs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Mirrors cairo_xlib_surface_set_drawable, allowing the drawable
targeted by a surface to be changed on the fly.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Any function documented with gtk-doc must not have _ in any parameter
names, or at least that's what I've found. This patch simply renames
parameters as needed to make things work.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Only allow one owner to keep their snapshot on the subsurface, and
so automatically replace any previous snapshot.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When the sample extents exceed the subsurface bounds we need to clone
the subsurface into a regular surface in order to correctly handle the
CAIRO_EXTEND_NONE extend mode (i.e prevent sampling out-of-bounds).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As discussed, overloading the cairo_surface_t semantics to include
sources (i.e. read-only surfaces) was duplicating the definition of
cairo_pattern_t. So rather than introduce a new surface type with
pattern semantics, start along the thorny road of extensible pattern
types.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The traps compositor expects to be able to pass either in a surface or a
source to its composite functions, so make it so.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2fb4a0e119 made the
_cairo_surface_subsurface_set_snapshot available with default
visibility.
'make check' correctly points out that it should be marked as private.
If the sample is wholly contained within the subsurface of the original,
we can simply use the original with an offset; thereby only copying the
data if we are sampling outside the subsurface bounds.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In order to handle reference cycles during finish (through snapshots) we
need to bump the reference on the surface first.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Following the previous commit, we only allocate a simple image when
acquiring the source so we only need to unreference it upon release.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Remove all of the special casing and simply extract the source. The time
for special casing is to avoid calling the generic acquire in the first
place, so kiss.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In order to handle out-of-bounds sampling of a subsurface target we need
to first avoid incorrectly unwrapping it.
Fixes crash in subsurface-outside-target
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>