Commit 47874aac authored by Chris Wilson's avatar Chris Wilson 🤔
Browse files

snapshot: Assert that we do not generate a snapshot clone


Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 161836ab
...@@ -172,10 +172,8 @@ _analyze_recording_surface_pattern (cairo_analysis_surface_t *surface, ...@@ -172,10 +172,8 @@ _analyze_recording_surface_pattern (cairo_analysis_surface_t *surface,
if (_cairo_surface_is_snapshot (source)) if (_cairo_surface_is_snapshot (source))
source = _cairo_surface_snapshot_get_target (source); source = _cairo_surface_snapshot_get_target (source);
if (source->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) { if (_cairo_surface_is_subsurface (source))
cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) source; source = _cairo_surface_subsurface_get_target (source);
source = sub->target;
}
status = _cairo_recording_surface_replay_and_create_regions (source, &tmp->base); status = _cairo_recording_surface_replay_and_create_regions (source, &tmp->base);
detach_proxy (proxy); detach_proxy (proxy);
......
...@@ -157,6 +157,7 @@ _cairo_surface_snapshot_copy_on_write (cairo_surface_t *surface) ...@@ -157,6 +157,7 @@ _cairo_surface_snapshot_copy_on_write (cairo_surface_t *surface)
done: done:
status = _cairo_surface_set_error (surface, clone->status); status = _cairo_surface_set_error (surface, clone->status);
assert (! _cairo_surface_is_snapshot (clone));
snapshot->target = snapshot->clone = clone; snapshot->target = snapshot->clone = clone;
snapshot->base.type = clone->type; snapshot->base.type = clone->type;
} }
...@@ -195,7 +196,7 @@ _cairo_surface_snapshot (cairo_surface_t *surface) ...@@ -195,7 +196,7 @@ _cairo_surface_snapshot (cairo_surface_t *surface)
if (surface->snapshot_of != NULL) if (surface->snapshot_of != NULL)
return cairo_surface_reference (surface); return cairo_surface_reference (surface);
if (surface->backend == &_cairo_surface_snapshot_backend) if (_cairo_surface_is_snapshot (surface))
return cairo_surface_reference (surface); return cairo_surface_reference (surface);
snapshot = (cairo_surface_snapshot_t *) snapshot = (cairo_surface_snapshot_t *)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment