third_party/cairo/src/cairo-xcb-surface.c
cairo_surface_t *
cairo_xcb_surface_create_for_bitmap (xcb_connection_t	*connection,
				     xcb_screen_t	*screen,
				     xcb_pixmap_t	 bitmap,
				     int		 width,
				     int		 height)
{
    cairo_xcb_screen_t *cairo_xcb_screen;

    if (xcb_connection_has_error (connection))
	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_WRITE_ERROR));

    if (width > XLIB_COORD_MAX || height > XLIB_COORD_MAX)
	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE));
    if (unlikely (width <= 0 || height <= 0))
	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE));

    cairo_xcb_screen = _cairo_xcb_screen_get (connection, screen);
    if (unlikely (cairo_xcb_screen == NULL))
	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));

    return _cairo_xcb_surface_create_internal (cairo_xcb_screen, bitmap, FALSE,
					       PIXMAN_a1,
					       cairo_xcb_screen->connection->standard_formats[CAIRO_FORMAT_A1],
					       width, height);
}
/**
 * cairo_xcb_surface_create_for_bitmap:
 * @connection: an XCB connection
 * @screen: the XCB screen associated with @bitmap
 * @bitmap: an XCB drawable (a Pixmap with depth 1)
 * @width: the current width of @bitmap
 * @height: the current height of @bitmap
 *
 * Creates an XCB surface that draws to the given bitmap.
 * This will be drawn to as a %CAIRO_FORMAT_A1 object.
 *
 * Return value: a pointer to the newly created surface. The caller
 * owns the surface and should call cairo_surface_destroy() when done
 * with it.
 *
 * This function always returns a valid pointer, but it will return a
 * pointer to a "nil" surface if an error such as out of memory
 * occurs. You can use cairo_surface_status() to check for this.
 *
 * Since: 1.12
 **/


Creates an XCB surface that draws to the given bitmap.
This will be drawn to as a %CAIRO_FORMAT_A1 object.

Return value: a pointer to the newly created surface. The caller
owns the surface and should call cairo_surface_destroy() when done
with it.

This function always returns a valid pointer, but it will return a
pointer to a "nil" surface if an error such as out of memory
occurs. You can use cairo_surface_status() to check for this.


Creates an XCB surface that draws to the given bitmap . This will be drawn to as a %CAIRO_FORMAT_A1 object . Return value : a pointer to the newly created surface . The caller owns the surface and should call cairo_surface_destroy () when done with it . This function always returns a valid pointer but it will return a pointer to a " nil " surface if an error such as out of memory occurs . You can use cairo_surface_status () to check for this .
cairo_surface_t *
cairo_xcb_surface_create_for_bitmap (xcb_connection_t	*connection,
				     xcb_screen_t	*screen,
				     xcb_pixmap_t	 bitmap,
				     int		 width,
				     int		 height)
{
    cairo_xcb_screen_t *cairo_xcb_screen;
    if (xcb_connection_has_error (connection))
	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_WRITE_ERROR));
    if (width > XLIB_COORD_MAX || height > XLIB_COORD_MAX)
	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE));
    if (unlikely (width <= 0 || height <= 0))
	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE));
    cairo_xcb_screen = _cairo_xcb_screen_get (connection, screen);
    if (unlikely (cairo_xcb_screen == NULL))
	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
    return _cairo_xcb_surface_create_internal (cairo_xcb_screen, bitmap, FALSE,
					       PIXMAN_a1,
					       cairo_xcb_screen->connection->standard_formats[CAIRO_FORMAT_A1],
					       width, height);
}
cairo_surface_t * cairo_xcb_surface_create_for_bitmap ( xcb_connection_t * connection , xcb_screen_t * screen , xcb_pixmap_t bitmap , int width , int height ) { cairo_xcb_screen_t * cairo_xcb_screen ; if ( xcb_connection_has_error ( connection ) ) return _cairo_surface_create_in_error ( _cairo_error ( CAIRO_STATUS_WRITE_ERROR ) ) ; if ( width > XLIB_COORD_MAX || height > XLIB_COORD_MAX ) return _cairo_surface_create_in_error ( _cairo_error ( CAIRO_STATUS_INVALID_SIZE ) ) ; if ( unlikely ( width <= 0 || height <= 0 ) ) return _cairo_surface_create_in_error ( _cairo_error ( CAIRO_STATUS_INVALID_SIZE ) ) ; cairo_xcb_screen = _cairo_xcb_screen_get ( connection , screen ) ; if ( unlikely ( cairo_xcb_screen == NULL ) ) return _cairo_surface_create_in_error ( _cairo_error ( CAIRO_STATUS_NO_MEMORY ) ) ; return _cairo_xcb_surface_create_internal ( cairo_xcb_screen , bitmap , FALSE , PIXMAN_a1 , cairo_xcb_screen -> connection -> standard_formats [ CAIRO_FORMAT_A1 ] , width , height ) ; }
cairo_xcb_surface_create_for_bitmap:
 @connection: an XCB connection
 @screen: the XCB screen associated with @bitmap
 @bitmap: an XCB drawable (a Pixmap with depth 1)
 @width: the current width of @bitmap
 @height: the current height of @bitmap
cairo_xcb_surface_create_for_bitmap : @connection : an XCB connection @screen : the XCB screen associated with @bitmap @bitmap : an XCB drawable ( a Pixmap with depth 1 ) @width : the current width of @bitmap @height : the current height of @bitmap