Commit e4587514 authored by Heiko Lewin's avatar Heiko Lewin
Browse files

Merge branch 'snapshot-error-fixes' into 'master'

Slightly improve dealing with error snapshots

See merge request cairo/cairo!92
parents 891468f1 66c99118
......@@ -1784,6 +1784,11 @@ _cairo_recording_surface_merge_source_attributes (cairo_recording_surface_t *su
if (_cairo_surface_is_snapshot (surf))
free_me = surf = _cairo_surface_snapshot_get_target (surf);
if (unlikely (surf->status))
// There was some kind of error and the surface could be a nil error
// surface with various "problems" (e.g. ->backend == NULL).
return;
if (surf->type == CAIRO_SURFACE_TYPE_RECORDING) {
cairo_recording_surface_t *rec_surf = (cairo_recording_surface_t *) surf;
......
......@@ -71,6 +71,8 @@ _cairo_surface_snapshot_flush (void *abstract_surface, unsigned flags)
cairo_status_t status;
target = _cairo_surface_snapshot_get_target (&surface->base);
status = target->status;
if (status == CAIRO_STATUS_SUCCESS)
status = _cairo_surface_flush (target, flags);
cairo_surface_destroy (target);
......
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