[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.
This commit is contained in:
Behdad Esfahbod 2007-02-28 13:46:27 -05:00
parent d30178b3dc
commit 07d61af809
2 changed files with 13 additions and 7 deletions

View file

@ -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

View file

@ -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)));