[cairo-paginated-surface] Set error on surface for operations done its behalf.

Ensure that the error is propagated to the target surface if we fail
whilst performing an operation on its behalf, for example set the size
of the paginated surface.
This commit is contained in:
Chris Wilson 2008-01-13 10:28:11 +00:00
parent 481b88dd6b
commit 3fed79d1c2

View file

@ -149,7 +149,7 @@ _cairo_paginated_surface_set_size (cairo_surface_t *surface,
width, height);
status = cairo_surface_status (paginated_surface->meta);
if (status)
return status;
return _cairo_surface_set_error (surface, status);
return CAIRO_STATUS_SUCCESS;
}
@ -293,7 +293,8 @@ _paint_page (cairo_paginated_surface_t *surface)
analysis = _cairo_analysis_surface_create (surface->target,
surface->width, surface->height);
if (analysis == NULL)
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
return _cairo_surface_set_error (surface->target,
CAIRO_STATUS_NO_MEMORY);
surface->backend->set_paginated_mode (surface->target, CAIRO_PAGINATED_MODE_ANALYZE);
status = _cairo_meta_surface_replay_and_create_regions (surface->meta, analysis);