Implement clone_surface for test-fallback-surface.

A few tests were failing due to clip_init_deep_copy() not being able to
clone the target surface. Before propagating the failure, this was being
silently ignored.

Copy the simple implementation from cairo-image-surface.
This commit is contained in:
Chris Wilson 2007-04-04 11:17:23 +01:00 committed by Carl Worth
parent 4456ecbf26
commit 90803eca0f

View file

@ -169,6 +169,26 @@ _test_fallback_surface_release_dest_image (void *abstract_surface,
image_extra);
}
static cairo_status_t
_test_fallback_surface_clone_similar (void *abstract_surface,
cairo_surface_t *src,
int src_x,
int src_y,
int width,
int height,
cairo_surface_t **clone_out)
{
test_fallback_surface_t *surface = abstract_surface;
if (src->backend == surface->base.backend) {
*clone_out = cairo_surface_reference (src);
return CAIRO_STATUS_SUCCESS;
}
return CAIRO_INT_STATUS_UNSUPPORTED;
}
static cairo_int_status_t
_test_fallback_surface_get_extents (void *abstract_surface,
cairo_rectangle_int16_t *rectangle)
@ -186,7 +206,7 @@ const cairo_surface_backend_t test_fallback_surface_backend = {
_test_fallback_surface_release_source_image,
_test_fallback_surface_acquire_dest_image,
_test_fallback_surface_release_dest_image,
NULL, /* clone_similar */
_test_fallback_surface_clone_similar,
NULL, /* composite */
NULL, /* fill_rectangles */
NULL, /* composite_trapezoids */