Commit 4a678afd authored by Chris Wilson's avatar Chris Wilson 🤔
Browse files

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

parent b74cc0f6
......@@ -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)) {
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment