Only reduce the clip if it is not in active use for the operation

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
test/line-width: Refactor and tidy

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
test: Add a couple of variants to line-width-overlap

The bug may be in only the fast-path, but future bugs may lie elsewhere.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
stroke: Rely on the tessellator to remove self-intersections

As handling joins/caps between line segments shorter than
half_line_width is tricky.

Rather than also fixing the bug in traps, remove that code. The plan is
to avoiding hitting the traps code, short-circuiting several steps along
the fast rectangular paths.

Fixes line-width-overlap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Add missing 'cairo-image-surface-private.h'

It was supposed to be the centre point of e849e7c92, but I had a little
battle with git and lost...

Reported-by: James Cloos <cloos@jhcloos.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
test/xlib-expose-event: Be kinder to recording surfaces

And only create the source image once.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
script: Emit sequences of boxes to as 'rectangle' for clarity

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
ps: use deflate compression for ps level 3
snapshot: Defer acquisition

Fixes 'xlib-expose-event' but triggers an infinite loop in self-copy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
script: Support unbounded native recording surfaces

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
recording: remove the duplicate 'content' field

Just use the member in the base class.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
recording: break self-copy loop

This is the root cause of the issue why we never succeeded in
implementing deferred snapshot correctly; that is we decoupled the
source from the target in the upper layers before we make the coupling
inside the lowest level of recording surface. By deferring the copy, we
never saw the detach-snapshot in time.

Fortunately this was only an issue for backends that implemented strong
immutable source semantics! The oversight implies that we need to push
down a similar flush mechanism into all backends.

Fixes self-copy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
subsurface: call the high-level cairo_surface_flush

And not the backend directly as this bypasses the extra steps taken in
the higher level to do common actions such as detach snapshots.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
subsurface+recording: handle recursion

Ouch, a nasty bug surfaces after rearranging code to fix the others.
Another self-copy loop this time through a subsurface of a recording
surface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
image: peek through a snapshot to the recording surface behind

Fixes record-* after the recent overhaul.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
paginated: unwrap subsurfaces during context creation

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
analysis: prevent recursion whilst analysing recording patterns

Thanks to subsurface recursion. There's a pattern here, but no clean
solution has yet presented itself.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
ps: unwrap recording surface snapshots

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
snapshot: Assert that we do not generate a snapshot clone

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
paginated: Use the backend->snapshot

The high-level function creates a new lazy snapshot which is not what we
what - we want a snapshot now!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>