mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-13 23:20:29 +01:00
snapshot: Simply memcpy if the cloned image matches the original.
This commit is contained in:
parent
b74cc0f6d5
commit
4a678afdf7
1 changed files with 10 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue