diff --git a/src/cairo-surface-snapshot.c b/src/cairo-surface-snapshot.c index 4277f66d6..5e1ec749f 100644 --- a/src/cairo-surface-snapshot.c +++ b/src/cairo-surface-snapshot.c @@ -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;