diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c index cda40b1..4c27567 100644 --- a/src/cairo-gstate.c +++ b/src/cairo-gstate.c @@ -1086,13 +1086,13 @@ BAIL: cairo_status_t _cairo_gstate_copy_page (cairo_gstate_t *gstate) { - return _cairo_surface_copy_page (gstate->target); + return cairo_surface_copy_page (gstate->target); } cairo_status_t _cairo_gstate_show_page (cairo_gstate_t *gstate) { - return _cairo_surface_show_page (gstate->target); + return cairo_surface_show_page (gstate->target); } static void diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c index 85f00fa..e4f1762 100644 --- a/src/cairo-paginated-surface.c +++ b/src/cairo-paginated-surface.c @@ -376,14 +376,14 @@ _cairo_paginated_surface_copy_page (void *abstract_surface) surface->page_num++; /* XXX: It might make sense to add some suport here for calling - * _cairo_surface_copy_page on the target surface. It would be an + * cairo_surface_copy_page on the target surface. It would be an * optimization for the output, (so that PostScript could include * copypage, for example), but the interaction with image * fallbacks gets tricky. For now, we just let the target see a * show_page and we implement the copying by simply not destroying * the meta-surface. */ - return _cairo_surface_show_page (surface->target); + return cairo_surface_show_page (surface->target); } static cairo_int_status_t @@ -400,7 +400,7 @@ _cairo_paginated_surface_show_page (void *abstract_surface) if (status) return status; - status = _cairo_surface_show_page (surface->target); + status = cairo_surface_show_page (surface->target); if (status) return status; diff --git a/src/cairo-surface.c b/src/cairo-surface.c index d3f100d..2b6553f 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -1585,8 +1585,19 @@ _cairo_surface_composite_trapezoids (cairo_operator_t op, traps, num_traps); } +/** + * cairo_surface_copy_page: + * @suface: a #cairo_surface_t + * + * Emits the current page for backends that support multiple pages, + * but doesn't clear it, so that the contents of the current page will + * be retained for the next page. Use cairo_surface_show_page() if you + * want to get an empty page after the emission. + * + * Since: 1.6 + */ cairo_status_t -_cairo_surface_copy_page (cairo_surface_t *surface) +cairo_surface_copy_page (cairo_surface_t *surface) { assert (! surface->is_snapshot); @@ -1602,9 +1613,20 @@ _cairo_surface_copy_page (cairo_surface_t *surface) return surface->backend->copy_page (surface); } +slim_hidden_def (cairo_surface_copy_page); + +/** + * cairo_surface_show_page: + * @surface: a #cairo_Surface_t + * + * Emits and clears the current page for backends that support multiple + * pages. Use cairo_surface_copy_page() if you don't want to clear the page. + * + * Since: 1.6 + **/ cairo_status_t -_cairo_surface_show_page (cairo_surface_t *surface) +cairo_surface_show_page (cairo_surface_t *surface) { assert (! surface->is_snapshot); @@ -1620,6 +1642,7 @@ _cairo_surface_show_page (cairo_surface_t *surface) return surface->backend->show_page (surface); } +slim_hidden_def (cairo_surface_show_page); /** * _cairo_surface_get_current_clip_serial: diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c index eafec32..b4e9270 100644 --- a/src/cairo-svg-surface.c +++ b/src/cairo-svg-surface.c @@ -991,7 +991,7 @@ _cairo_svg_surface_emit_meta_surface (cairo_svg_document_t *document, return status; } - status = _cairo_surface_show_page (paginated_surface); + status = cairo_surface_show_page (paginated_surface); if (status) { cairo_surface_destroy (&meta->base); return status; diff --git a/src/cairo.c b/src/cairo.c index f3c2f16..268083c 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -2107,6 +2107,8 @@ slim_hidden_def(cairo_fill_preserve); * doesn't clear it, so, the contents of the current page will be retained * for the next page too. Use cairo_show_page() if you want to get an * empty page after the emission. + * + * Deprecated in 1.6; use cairo_surface_copy_page() instead. **/ void cairo_copy_page (cairo_t *cr) @@ -2127,6 +2129,8 @@ cairo_copy_page (cairo_t *cr) * * Emits and clears the current page for backends that support multiple * pages. Use cairo_copy_page() if you don't want to clear the page. + * + * Deprecated in 1.6; use cairo_surface_show_page() instead. **/ void cairo_show_page (cairo_t *cr) diff --git a/src/cairo.h b/src/cairo.h index 8c3718f..636c417 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -1535,6 +1535,12 @@ cairo_surface_set_fallback_resolution (cairo_surface_t *surface, double x_pixels_per_inch, double y_pixels_per_inch); +cairo_public cairo_status_t +cairo_surface_copy_page (cairo_surface_t *surface); + +cairo_public cairo_status_t +cairo_surface_show_page (cairo_surface_t *surface); + /* Image-surface functions */ /** diff --git a/src/cairoint.h b/src/cairoint.h index 58f2ea3..39cb025 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -1829,12 +1829,6 @@ _cairo_surface_composite_trapezoids (cairo_operator_t op, int ntraps); cairo_private cairo_status_t -_cairo_surface_copy_page (cairo_surface_t *surface); - -cairo_private cairo_status_t -_cairo_surface_show_page (cairo_surface_t *surface); - -cairo_private cairo_status_t _cairo_surface_acquire_source_image (cairo_surface_t *surface, cairo_image_surface_t **image_out, void **image_extra); @@ -2455,6 +2449,8 @@ slim_hidden_proto (cairo_surface_mark_dirty_rectangle); slim_hidden_proto_no_warn (cairo_surface_reference); slim_hidden_proto (cairo_surface_set_device_offset); slim_hidden_proto (cairo_surface_set_fallback_resolution); +slim_hidden_proto (cairo_surface_copy_page); +slim_hidden_proto (cairo_surface_show_page); slim_hidden_proto (cairo_surface_status); slim_hidden_proto (cairo_version_string);