From cc94dce25085fef936b7cb36cf9fc41569668eba Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 28 Jan 2008 15:26:15 -0800 Subject: [PATCH] Return NULL from cairo_xlib_surface_get_xrender_format without an error The NULL return value will only happen if the X Render extension is not available. We've already got that NULL return value documented, so it's not an error if the user asks for it. In particular, it's definitely not a surface-type mismatch. --- src/cairo-xlib-surface.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 96d4d732c..c7778108d 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -2168,7 +2168,7 @@ slim_hidden_def (cairo_xlib_surface_create_with_xrender_format); * * Return value: the XRenderPictFormat* with which the surface was * originally created, (or NULL if the surface is not an xlib surface - * or if the Render extension is not available). + * or if the X Render extension is not available). */ XRenderPictFormat * cairo_xlib_surface_get_xrender_format (cairo_surface_t *surface) @@ -2181,10 +2181,6 @@ cairo_xlib_surface_get_xrender_format (cairo_surface_t *surface) return NULL; } - /* And also for an xlib surface that is not an xlib-xrender surface */ - if (xlib_surface->xrender_format == NULL) - _cairo_error_throw (CAIRO_STATUS_SURFACE_TYPE_MISMATCH); - return xlib_surface->xrender_format; } #endif