[cairo-surface] Add the usual guards to the API entry point.

Add the checks for unmodifiable surfaces (snapshots, finished and error) to
cairo_surface_set_fallback_resolution.
This commit is contained in:
Chris Wilson 2007-10-05 09:44:29 +01:00
parent f3ae783c9c
commit 41aab58f3a

View file

@ -882,6 +882,18 @@ cairo_surface_set_fallback_resolution (cairo_surface_t *surface,
double x_pixels_per_inch,
double y_pixels_per_inch)
{
cairo_status_t status;
assert (! surface->is_snapshot);
if (surface->status)
return;
if (surface->finished) {
status = _cairo_surface_set_error (surface, CAIRO_STATUS_SURFACE_FINISHED);
return;
}
surface->x_fallback_resolution = x_pixels_per_inch;
surface->y_fallback_resolution = y_pixels_per_inch;
}