mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-27 00:50:25 +01:00
surface: replace map-to-image clone's use of user_data with parent pointer
Removes an another undeclared PLT entry and prevents mixing of user_data with internal state. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
9e933d4b87
commit
c0a92bf832
3 changed files with 7 additions and 14 deletions
|
|
@ -56,6 +56,12 @@ _cairo_image_surface_set_parent (cairo_image_surface_t *image,
|
|||
image->parent = parent;
|
||||
}
|
||||
|
||||
static inline cairo_bool_t
|
||||
_cairo_image_surface_is_clone (cairo_image_surface_t *image)
|
||||
{
|
||||
return image->parent != NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* _cairo_surface_is_image:
|
||||
* @surface: a #cairo_surface_t
|
||||
|
|
|
|||
|
|
@ -220,9 +220,6 @@ cairo_private cairo_image_surface_t *
|
|||
_cairo_image_surface_clone_subimage (cairo_surface_t *surface,
|
||||
const cairo_rectangle_int_t *extents);
|
||||
|
||||
cairo_private cairo_bool_t
|
||||
_cairo_image_surface_is_clone (cairo_image_surface_t *surface);
|
||||
|
||||
CAIRO_END_DECLS
|
||||
|
||||
#endif /* CAIRO_IMAGE_SURFACE_PRIVATE_H */
|
||||
|
|
|
|||
|
|
@ -1206,8 +1206,6 @@ _cairo_image_analyze_color (cairo_image_surface_t *image)
|
|||
return image->color = CAIRO_IMAGE_IS_COLOR;
|
||||
}
|
||||
|
||||
static const cairo_user_data_key_t clone_key;
|
||||
|
||||
cairo_image_surface_t *
|
||||
_cairo_image_surface_clone_subimage (cairo_surface_t *surface,
|
||||
const cairo_rectangle_int_t *extents)
|
||||
|
|
@ -1242,9 +1240,7 @@ _cairo_image_surface_clone_subimage (cairo_surface_t *surface,
|
|||
if (unlikely (status))
|
||||
goto error;
|
||||
|
||||
status = cairo_surface_set_user_data (image, &clone_key, surface, NULL);
|
||||
if (unlikely (status))
|
||||
goto error;
|
||||
_cairo_image_surface_set_parent (to_image_surface (image), surface);
|
||||
|
||||
return to_image_surface (image);
|
||||
|
||||
|
|
@ -1252,9 +1248,3 @@ error:
|
|||
cairo_surface_destroy (image);
|
||||
return to_image_surface (_cairo_surface_create_in_error (status));
|
||||
}
|
||||
|
||||
cairo_bool_t
|
||||
_cairo_image_surface_is_clone (cairo_image_surface_t *image)
|
||||
{
|
||||
return cairo_surface_get_user_data (&image->base, &clone_key) != NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue