summaryrefslogtreecommitdiff
path: root/src/cairo-paginated-surface.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-04-14 14:46:59 -0700
committerCarl Worth <cworth@cworth.org>2006-04-14 14:46:59 -0700
commit8d3a800b82ccd4a39bf04cc1d602eb84d90f81d1 (patch)
tree9bf933a6884ed97d496d12d7ab2b19b17f4161d5 /src/cairo-paginated-surface.c
parent687802cca67ce4157725316d769fc28bc75f5dcd (diff)
downloadcairo-8d3a800b82ccd4a39bf04cc1d602eb84d90f81d1.tar.gz
Add a start_page function to the paginated_surface_backend.
This allows for any surface using the paginated_surface backend to easily do stuff at the beginning of each page, (such as writing out any per-page header necessary). This replaces some of the per-page state tracking that the PS surface was doing, (though it still has some left for its optimization of CLEAR on a blank page).
Diffstat (limited to 'src/cairo-paginated-surface.c')
-rw-r--r--src/cairo-paginated-surface.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index 26be21929..475db3e54 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -266,11 +266,25 @@ _paint_page (cairo_paginated_surface_t *surface)
return CAIRO_STATUS_SUCCESS;
}
+static cairo_status_t
+_start_page (cairo_paginated_surface_t *surface)
+{
+ if (! surface->backend->start_page)
+ return CAIRO_STATUS_SUCCESS;
+
+ return (surface->backend->start_page) (surface->target);
+}
+
static cairo_int_status_t
_cairo_paginated_surface_copy_page (void *abstract_surface)
{
+ cairo_status_t status;
cairo_paginated_surface_t *surface = abstract_surface;
+ status = _start_page (surface);
+ if (status)
+ return status;
+
_paint_page (surface);
/* XXX: It might make sense to add some suport here for calling
@@ -289,8 +303,13 @@ _cairo_paginated_surface_copy_page (void *abstract_surface)
static cairo_int_status_t
_cairo_paginated_surface_show_page (void *abstract_surface)
{
+ cairo_status_t status;
cairo_paginated_surface_t *surface = abstract_surface;
+ status = _start_page (surface);
+ if (status)
+ return status;
+
_paint_page (surface);
_cairo_surface_show_page (surface->target);