[cairo-commit] Changes to 'master'

Christian Biesinger biesi at kemper.freedesktop.org
Sat Feb 18 12:46:05 PST 2006


 src/cairo-beos-surface.cpp |   26 +++++++-------------------
 1 files changed, 7 insertions(+), 19 deletions(-)

New commits:
diff-tree 0fc25c9853441f1fc2e49e7c77dbf9a99f590868 (from 5c5ea6d5233a669f6a7dff57ed0afba01131b7b5)
Author: Christian Biesinger <cbiesinger at web.de>
Date:   Sat Feb 18 21:45:58 2006 +0100

    Don't call _cairo_error when returning an error
    
    Only return it when returning a nil surface.

diff --git a/src/cairo-beos-surface.cpp b/src/cairo-beos-surface.cpp
index 38d2f4f..b6448fa 100644
--- a/src/cairo-beos-surface.cpp
+++ b/src/cairo-beos-surface.cpp
@@ -431,35 +431,28 @@ _cairo_beos_surface_acquire_source_image
     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 (
     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 (
 	*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 (
 
     *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;


More information about the cairo-commit mailing list