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.
This commit is contained in:
Carl Worth 2008-01-28 15:26:15 -08:00
parent 3c018a6e5a
commit cc94dce250

View file

@ -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