snapshot: Simply memcpy if the cloned image matches the original.

This commit is contained in:
Chris Wilson 2010-04-27 18:57:56 +01:00
parent b74cc0f6d5
commit 4a678afdf7

View file

@ -136,12 +136,16 @@ _cairo_surface_snapshot_copy_on_write (cairo_surface_t *surface)
image->height,
0);
if (likely (clone->base.status == CAIRO_STATUS_SUCCESS)) {
pixman_image_composite32 (PIXMAN_OP_SRC,
image->pixman_image, NULL, clone->pixman_image,
0, 0,
0, 0,
0, 0,
image->width, image->height);
if (clone->stride == image->stride) {
memcpy (clone->data, image->data, image->stride * image->height);
} else {
pixman_image_composite32 (PIXMAN_OP_SRC,
image->pixman_image, NULL, clone->pixman_image,
0, 0,
0, 0,
0, 0,
image->width, image->height);
}
clone->base.is_clear = FALSE;
snapshot->clone = &clone->base;