summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2007-02-28 13:46:27 -0500
committerBehdad Esfahbod <behdad@behdad.org>2007-02-28 13:46:27 -0500
commit07d61af8093be501e93d64cc7df69f95ecb83b6c (patch)
treebfe320eed570c743ddcfc7d9e81bbe768b6af593
parentd30178b3dcebcdd89dc773881fc1b9097f1f50a7 (diff)
[paginated] Automatically issue a final cairo_show_page()
This means, PS/PDF/SVG do not need the final cairo_show_page() anymore. If there is any drawing in the page, a cairo_show_page() is done automatically.
-rw-r--r--src/cairo-paginated-surface.c18
-rwxr-xr-xtest/cairo-test.c2
2 files changed, 13 insertions, 7 deletions
diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index 6c1ff6ab..b093bca4 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -155,12 +155,22 @@ static cairo_status_t
_cairo_paginated_surface_finish (void *abstract_surface)
{
cairo_paginated_surface_t *surface = abstract_surface;
+ cairo_status_t status = CAIRO_STATUS_SUCCESS;
- cairo_surface_destroy (surface->meta);
+ if (!surface->page_is_blank)
+ status = _cairo_paginated_surface_show_page (abstract_surface);
+
+ if (status == CAIRO_STATUS_SUCCESS)
+ cairo_surface_finish (surface->target);
+
+ if (status == CAIRO_STATUS_SUCCESS)
+ cairo_surface_finish (surface->meta);
cairo_surface_destroy (surface->target);
- return CAIRO_STATUS_SUCCESS;
+ cairo_surface_destroy (surface->meta);
+
+ return status;
}
static cairo_surface_t *
@@ -296,9 +306,7 @@ _cairo_paginated_surface_copy_page (void *abstract_surface)
* show_page and we implement the copying by simply not destroying
* the meta-surface. */
- _cairo_surface_show_page (surface->target);
-
- return CAIRO_STATUS_SUCCESS;
+ return _cairo_surface_show_page (surface->target);
}
static cairo_int_status_t
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 498eb8e3..16173b66 100755
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -287,8 +287,6 @@ cairo_test_for_target (cairo_test_t *test,
goto UNWIND_CAIRO;
}
- cairo_show_page (cr);
-
if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) {
cairo_test_log ("Error: Function under test left cairo status in an error state: %s\n",
cairo_status_to_string (cairo_status (cr)));