Commit 48d84716 authored by Chris Wilson's avatar Chris Wilson 🤔
Browse files

recording: Cleanup the clip on error.

Whilst recording the commands, remember to cleanup the local clip after
detecting an error.
parent c87737c2
......@@ -347,6 +347,7 @@ _cairo_recording_surface_paint (void *abstract_surface,
CLEANUP_SOURCE:
_cairo_pattern_fini_snapshot (&command->source.base);
CLEANUP_COMMAND:
_cairo_clip_fini (&command->header.clip);
free (command);
return status;
}
......@@ -390,6 +391,7 @@ _cairo_recording_surface_mask (void *abstract_surface,
CLEANUP_SOURCE:
_cairo_pattern_fini_snapshot (&command->source.base);
CLEANUP_COMMAND:
_cairo_clip_fini (&command->header.clip);
free (command);
return status;
}
......@@ -449,6 +451,7 @@ _cairo_recording_surface_stroke (void *abstract_surface,
CLEANUP_SOURCE:
_cairo_pattern_fini_snapshot (&command->source.base);
CLEANUP_COMMAND:
_cairo_clip_fini (&command->header.clip);
free (command);
return status;
}
......@@ -499,6 +502,7 @@ _cairo_recording_surface_fill (void *abstract_surface,
CLEANUP_SOURCE:
_cairo_pattern_fini_snapshot (&command->source.base);
CLEANUP_COMMAND:
_cairo_clip_fini (&command->header.clip);
free (command);
return status;
}
......@@ -592,6 +596,7 @@ _cairo_recording_surface_show_text_glyphs (void *abstract_surface,
_cairo_pattern_fini_snapshot (&command->source.base);
CLEANUP_COMMAND:
_cairo_clip_fini (&command->header.clip);
free (command);
return status;
}
......
......@@ -119,6 +119,7 @@ _cairo_surface_snapshot_copy_on_write (cairo_surface_t *surface)
status = _cairo_surface_acquire_source_image (snapshot->target, &image, &extra);
if (unlikely (status)) {
snapshot->target = _cairo_surface_create_in_error (status);
status = _cairo_surface_set_error (surface, status);
return;
}
......@@ -140,6 +141,7 @@ _cairo_surface_snapshot_copy_on_write (cairo_surface_t *surface)
snapshot->clone = &clone->base;
} else {
snapshot->clone = &clone->base;
status = _cairo_surface_set_error (surface, clone->base.status);
}
_cairo_surface_release_source_image (snapshot->target, image, extra);
......
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