mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 14:58:06 +02:00
[cairo-meta-surface] Save and restore the original clip.
When replaying the meta-surface to the target, we apply a stack-based clip to the surface. However, we did not remove this clip from the surface and so a pointer into our stack existed beyond the scope of function. Saving the original clip pointer and restoring it before leaving the function resolves the issue and appears to fix https://bugzilla.mozilla.org/show_bug.cgi?id=429071.
This commit is contained in:
parent
a2c4fd0572
commit
ea6dbfd36f
1 changed files with 6 additions and 2 deletions
|
|
@ -658,8 +658,8 @@ _cairo_meta_surface_replay_internal (cairo_surface_t *surface,
|
||||||
cairo_meta_surface_t *meta;
|
cairo_meta_surface_t *meta;
|
||||||
cairo_command_t *command, **elements;
|
cairo_command_t *command, **elements;
|
||||||
int i, num_elements;
|
int i, num_elements;
|
||||||
cairo_int_status_t status;
|
cairo_int_status_t status, status2;
|
||||||
cairo_clip_t clip;
|
cairo_clip_t clip, *old_clip;
|
||||||
cairo_bool_t has_device_transform = _cairo_surface_has_device_transform (target);
|
cairo_bool_t has_device_transform = _cairo_surface_has_device_transform (target);
|
||||||
cairo_matrix_t *device_transform = &target->device_transform;
|
cairo_matrix_t *device_transform = &target->device_transform;
|
||||||
cairo_path_fixed_t path_copy, *dev_path;
|
cairo_path_fixed_t path_copy, *dev_path;
|
||||||
|
|
@ -674,6 +674,7 @@ _cairo_meta_surface_replay_internal (cairo_surface_t *surface,
|
||||||
status = CAIRO_STATUS_SUCCESS;
|
status = CAIRO_STATUS_SUCCESS;
|
||||||
|
|
||||||
_cairo_clip_init (&clip, target);
|
_cairo_clip_init (&clip, target);
|
||||||
|
old_clip = _cairo_surface_get_clip (target);
|
||||||
|
|
||||||
num_elements = meta->commands.num_elements;
|
num_elements = meta->commands.num_elements;
|
||||||
elements = _cairo_array_index (&meta->commands, 0);
|
elements = _cairo_array_index (&meta->commands, 0);
|
||||||
|
|
@ -867,6 +868,9 @@ _cairo_meta_surface_replay_internal (cairo_surface_t *surface,
|
||||||
}
|
}
|
||||||
|
|
||||||
_cairo_clip_reset (&clip);
|
_cairo_clip_reset (&clip);
|
||||||
|
status2 = _cairo_surface_set_clip (target, old_clip);
|
||||||
|
if (status == CAIRO_STATUS_SUCCESS)
|
||||||
|
status = status2;
|
||||||
|
|
||||||
return _cairo_surface_set_error (surface, status);
|
return _cairo_surface_set_error (surface, status);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue