mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-04-26 07:50:44 +02:00
[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:
parent
f3ae783c9c
commit
41aab58f3a
1 changed files with 12 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue