mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-13 21:30:19 +01:00
image: Add a reference for the clone's parent image
We use the parent as a flag during map-to-image/umap-image that the resultant image came from a fallback rather than as direct call to the backend's map_to_image(). Whilst we use it as a simple flag, we need to make sure the parent surface obeys the reference counting semantics and is consistent for all callers. Unlike other users of the parent pointer, there is no resource sharing between the two surfaces. Reported-by: Henry Song <henry.song@samsung.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
ec58fde294
commit
22b7fae036
1 changed files with 8 additions and 1 deletions
|
|
@ -1240,7 +1240,14 @@ _cairo_image_surface_clone_subimage (cairo_surface_t *surface,
|
|||
if (unlikely (status))
|
||||
goto error;
|
||||
|
||||
_cairo_image_surface_set_parent (to_image_surface (image), surface);
|
||||
/* We use the parent as a flag during map-to-image/umap-image that the
|
||||
* resultant image came from a fallback rather than as direct call
|
||||
* to the backend's map_to_image(). Whilst we use it as a simple flag,
|
||||
* we need to make sure the parent surface obeys the reference counting
|
||||
* semantics and is consistent for all callers.
|
||||
*/
|
||||
_cairo_image_surface_set_parent (to_image_surface (image),
|
||||
cairo_surface_reference (surface));
|
||||
|
||||
return to_image_surface (image);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue