[cairo-commit] src/cairo-xcb-surface.c

Uli Schlachter psychon at kemper.freedesktop.org
Sat Jun 11 12:03:03 PDT 2011


 src/cairo-xcb-surface.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ad01d571dd4f9240275a1d4c49cbd961e3f62c3c
Author: Uli Schlachter <psychon at znc.in>
Date:   Sat Jun 11 20:18:27 2011 +0200

    Revert "xcb: Never return NULL from create_similar"
    
    This reverts commit f6e6891b59656c944a7e758a53e07ed5f29f5c39.
    
    Returning NULL in these cases is actually the right thing to do, because the
    caller expects and handles this case.
    
    cairo_surface_create_similar() won't return NULL due to this, because
    _cairo_surface_create_similar_solid() will fall back to an image surface.
    
    I think I missed that part when I wrote the bad commit.
    
    This was found via the test suite's "zero-mask" test.
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c
index 3b0eb34..95121b4 100644
--- a/src/cairo-xcb-surface.c
+++ b/src/cairo-xcb-surface.c
@@ -186,10 +186,10 @@ _cairo_xcb_surface_create_similar (void			*abstract_other,
     cairo_status_t status;
 
     if (width > XLIB_COORD_MAX || height > XLIB_COORD_MAX)
-	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE));
+	return NULL;
 
     if (width <= 0 || height <= 0)
-	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE));
+	return NULL;
 
 #if CAIRO_HAS_DRM_SURFACE && CAIRO_HAS_XCB_DRM_FUNCTIONS
     if (other->drm != NULL) {


More information about the cairo-commit mailing list