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