diff options
author | Christian Biesinger <cbiesinger@web.de> | 2006-02-18 21:45:58 +0100 |
---|---|---|
committer | Christian Biesinger <cbiesinger@web.de> | 2006-02-18 21:45:58 +0100 |
commit | 0fc25c9853441f1fc2e49e7c77dbf9a99f590868 (patch) | |
tree | 58e057be2a83211c0e1215a82a5e372479650d9a /src | |
parent | 5c5ea6d5233a669f6a7dff57ed0afba01131b7b5 (diff) |
Don't call _cairo_error when returning an error
Only return it when returning a nil surface.
Diffstat (limited to 'src')
-rw-r--r-- | src/cairo-beos-surface.cpp | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/cairo-beos-surface.cpp b/src/cairo-beos-surface.cpp index 38d2f4f4..b6448fa6 100644 --- a/src/cairo-beos-surface.cpp +++ b/src/cairo-beos-surface.cpp @@ -431,35 +431,28 @@ _cairo_beos_surface_acquire_source_image (void *abstract_surfa cairo_beos_surface_t *surface = reinterpret_cast<cairo_beos_surface_t*>( abstract_surface); AutoLockView locker(surface->view); - if (!locker) { - _cairo_error(CAIRO_STATUS_NO_MEMORY); + if (!locker) return CAIRO_STATUS_NO_MEMORY; /// XXX not exactly right, but what can we do? - } surface->view->Sync(); if (surface->bitmap) { *image_out = _cairo_beos_bitmap_to_surface(surface->bitmap); - if (!*image_out) { - _cairo_error(CAIRO_STATUS_NO_MEMORY); + if (!*image_out) return CAIRO_STATUS_NO_MEMORY; - } *image_extra = NULL; return CAIRO_STATUS_SUCCESS; } BBitmap* bmp; - if (_cairo_beos_view_to_bitmap(surface->view, &bmp) != OK) { - _cairo_error(CAIRO_STATUS_NO_MEMORY); + if (_cairo_beos_view_to_bitmap(surface->view, &bmp) != OK) return CAIRO_STATUS_NO_MEMORY; /// XXX incorrect if the error was NOT_VISIBLE - } *image_out = _cairo_beos_bitmap_to_surface(bmp); if (!*image_out) { delete bmp; - _cairo_error(CAIRO_STATUS_NO_MEMORY); return CAIRO_STATUS_NO_MEMORY; } *image_extra = bmp; @@ -500,10 +493,8 @@ _cairo_beos_surface_acquire_dest_image (void *abstract_surface if (surface->bitmap) { surface->view->Sync(); *image_out = _cairo_beos_bitmap_to_surface(surface->bitmap); - if (!*image_out) { - _cairo_error(CAIRO_STATUS_NO_MEMORY); + if (!*image_out) return CAIRO_STATUS_NO_MEMORY; - } image_rect->x = 0; image_rect->y = 0; @@ -525,10 +516,8 @@ _cairo_beos_surface_acquire_dest_image (void *abstract_surface *image_extra = NULL; return CAIRO_STATUS_SUCCESS; } - if (status == ERROR) { - _cairo_error(CAIRO_STATUS_NO_MEMORY); + if (status == ERROR) return CAIRO_STATUS_NO_MEMORY; - } *image_rect = _brect_to_cairo_rect(rect); @@ -540,10 +529,9 @@ _cairo_beos_surface_acquire_dest_image (void *abstract_surface *image_out = _cairo_beos_bitmap_to_surface(bitmap); delete bitmap; - if (!*image_out) { - _cairo_error(CAIRO_STATUS_NO_MEMORY); + if (!*image_out) return CAIRO_STATUS_NO_MEMORY; - } + *image_extra = NULL; return CAIRO_STATUS_SUCCESS; |