summaryrefslogtreecommitdiff
path: root/src/cairo-paginated-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-01-18 19:05:34 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2010-01-22 23:01:50 +0000
commit934d0d0d6585eb7638c7db597c40dd821092c034 (patch)
tree2809f3241b797800ceefe375b89ae4f0b9a6a884 /src/cairo-paginated-surface.c
parent6b3e19aa434d159db7878b2a7fb28a026b2d1756 (diff)
Real zero-copy cow snapshotting
The first iteration of COW snapshotting always made an initial copy when the snapshot was requested (and reused that copy until the surface was modified). However, in a few circumstances we can avoid even that copy so long as the surface is still alive and unmodified between the snapshotting and its use. In order to do so, we need a new proxy surface that can automatically perform the copy if the target should disappear prior to use.
Diffstat (limited to 'src/cairo-paginated-surface.c')
-rw-r--r--src/cairo-paginated-surface.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index 80e4b72f..c6e20cc4 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -156,8 +156,11 @@ _cairo_paginated_surface_finish (void *abstract_surface)
cairo_status_t status = CAIRO_STATUS_SUCCESS;
if (surface->page_is_blank == FALSE || surface->page_num == 1) {
- cairo_surface_show_page (abstract_surface);
- status = cairo_surface_status (abstract_surface);
+ /* Bypass some of the sanity checking in cairo-surface.c, as we
+ * know that the surface is finished...
+ */
+ if (surface->base.backend->show_page != NULL)
+ status = surface->base.backend->show_page (&surface->base);
}
/* XXX We want to propagate any errors from destroy(), but those are not