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