third_party/cairo/src/cairo-xcb-connection.c
void
cairo_xcb_device_debug_cap_xrender_version (cairo_device_t *device,
                                            int major_version,
                                            int minor_version)
{
    cairo_xcb_connection_t *connection = (cairo_xcb_connection_t *) device;

    if (device->backend->type != CAIRO_DEVICE_TYPE_XCB) {
	cairo_status_t status;

	status = _cairo_device_set_error (device, CAIRO_STATUS_DEVICE_TYPE_MISMATCH);
	(void) status;
	return;
    }

    /* First reset all the RENDER flags to their original value. This works
     * because we only ever clear bits after the connection was created.
     */
    connection->flags |= (connection->original_flags & CAIRO_XCB_RENDER_MASK);

    /* clear any flags that are inappropriate for the desired version */
    if (major_version < 0 && minor_version < 0) {
	connection->flags &= ~(CAIRO_XCB_HAS_RENDER |
			       CAIRO_XCB_RENDER_HAS_COMPOSITE |
			       CAIRO_XCB_RENDER_HAS_COMPOSITE_GLYPHS |
			       CAIRO_XCB_RENDER_HAS_FILL_RECTANGLES |
			       CAIRO_XCB_RENDER_HAS_COMPOSITE_TRAPEZOIDS |
			       CAIRO_XCB_RENDER_HAS_PICTURE_TRANSFORM |
			       CAIRO_XCB_RENDER_HAS_FILTERS |
			       CAIRO_XCB_RENDER_HAS_FILTER_GOOD |
			       CAIRO_XCB_RENDER_HAS_FILTER_BEST |
			       CAIRO_XCB_RENDER_HAS_PDF_OPERATORS |
			       CAIRO_XCB_RENDER_HAS_EXTENDED_REPEAT |
			       CAIRO_XCB_RENDER_HAS_GRADIENTS);
    } else {
	xcb_render_query_version_reply_t version;

	version.major_version = major_version;
	version.minor_version = minor_version;

	if (! XCB_RENDER_HAS_FILL_RECTANGLES (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_FILL_RECTANGLES;

	if (! XCB_RENDER_HAS_TRAPEZOIDS (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_COMPOSITE_TRAPEZOIDS;

	if (! XCB_RENDER_HAS_PICTURE_TRANSFORM (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_PICTURE_TRANSFORM;

	if (! XCB_RENDER_HAS_FILTERS (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_FILTERS;

	if (! XCB_RENDER_HAS_PDF_OPERATORS (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_PDF_OPERATORS;

	if (! XCB_RENDER_HAS_EXTENDED_REPEAT (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_EXTENDED_REPEAT;

	if (! XCB_RENDER_HAS_GRADIENTS (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_GRADIENTS;
    }
}
/**
 * cairo_xcb_device_debug_cap_xrender_version:
 * @device: a #cairo_device_t for the XCB backend
 * @major_version: major version to restrict to
 * @minor_version: minor version to restrict to
 *
 * Restricts all future XCB surfaces for this devices to the specified version
 * of the RENDER extension. This function exists solely for debugging purpose.
 * It let's you find out how cairo would behave with an older version of
 * the RENDER extension.
 *
 * Use the special values -1 and -1 for disabling the RENDER extension.
 *
 * Since: 1.12
 **/
@device: a #cairo_device_t for the XCB backend
@major_version: major version to restrict to
@minor_version: minor version to restrict to

Restricts all future XCB surfaces for this devices to the specified version
of the RENDER extension. This function exists solely for debugging purpose.
It let's you find out how cairo would behave with an older version of
the RENDER extension.

Use the special values -1 and -1 for disabling the RENDER extension.


@device : a #cairo_device_t for the XCB backend @major_version : major version to restrict to @minor_version : minor version to restrict to Restricts all future XCB surfaces for this devices to the specified version of the RENDER extension . This function exists solely for debugging purpose . It let ' s you find out how cairo would behave with an older version of the RENDER extension . Use the special values - 1 and - 1 for disabling the RENDER extension .
void
cairo_xcb_device_debug_cap_xrender_version (cairo_device_t *device,
                                            int major_version,
                                            int minor_version)
{
    cairo_xcb_connection_t *connection = (cairo_xcb_connection_t *) device;
    if (device->backend->type != CAIRO_DEVICE_TYPE_XCB) {
	cairo_status_t status;
	status = _cairo_device_set_error (device, CAIRO_STATUS_DEVICE_TYPE_MISMATCH);
	(void) status;
	return;
    }
    connection->flags |= (connection->original_flags & CAIRO_XCB_RENDER_MASK);
    if (major_version < 0 && minor_version < 0) {
	connection->flags &= ~(CAIRO_XCB_HAS_RENDER |
			       CAIRO_XCB_RENDER_HAS_COMPOSITE |
			       CAIRO_XCB_RENDER_HAS_COMPOSITE_GLYPHS |
			       CAIRO_XCB_RENDER_HAS_FILL_RECTANGLES |
			       CAIRO_XCB_RENDER_HAS_COMPOSITE_TRAPEZOIDS |
			       CAIRO_XCB_RENDER_HAS_PICTURE_TRANSFORM |
			       CAIRO_XCB_RENDER_HAS_FILTERS |
			       CAIRO_XCB_RENDER_HAS_FILTER_GOOD |
			       CAIRO_XCB_RENDER_HAS_FILTER_BEST |
			       CAIRO_XCB_RENDER_HAS_PDF_OPERATORS |
			       CAIRO_XCB_RENDER_HAS_EXTENDED_REPEAT |
			       CAIRO_XCB_RENDER_HAS_GRADIENTS);
    } else {
	xcb_render_query_version_reply_t version;
	version.major_version = major_version;
	version.minor_version = minor_version;
	if (! XCB_RENDER_HAS_FILL_RECTANGLES (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_FILL_RECTANGLES;
	if (! XCB_RENDER_HAS_TRAPEZOIDS (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_COMPOSITE_TRAPEZOIDS;
	if (! XCB_RENDER_HAS_PICTURE_TRANSFORM (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_PICTURE_TRANSFORM;
	if (! XCB_RENDER_HAS_FILTERS (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_FILTERS;
	if (! XCB_RENDER_HAS_PDF_OPERATORS (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_PDF_OPERATORS;
	if (! XCB_RENDER_HAS_EXTENDED_REPEAT (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_EXTENDED_REPEAT;
	if (! XCB_RENDER_HAS_GRADIENTS (&version))
	    connection->flags &= ~CAIRO_XCB_RENDER_HAS_GRADIENTS;
    }
}
void cairo_xcb_device_debug_cap_xrender_version ( cairo_device_t * device , int major_version , int minor_version ) { cairo_xcb_connection_t * connection = ( cairo_xcb_connection_t * ) device ; if ( device -> backend -> type != CAIRO_DEVICE_TYPE_XCB ) { cairo_status_t status ; status = _cairo_device_set_error ( device , CAIRO_STATUS_DEVICE_TYPE_MISMATCH ) ; ( void ) status ; return ; } connection -> flags |= ( connection -> original_flags & CAIRO_XCB_RENDER_MASK ) ; if ( major_version < 0 && minor_version < 0 ) { connection -> flags &= ~ ( CAIRO_XCB_HAS_RENDER | CAIRO_XCB_RENDER_HAS_COMPOSITE | CAIRO_XCB_RENDER_HAS_COMPOSITE_GLYPHS | CAIRO_XCB_RENDER_HAS_FILL_RECTANGLES | CAIRO_XCB_RENDER_HAS_COMPOSITE_TRAPEZOIDS | CAIRO_XCB_RENDER_HAS_PICTURE_TRANSFORM | CAIRO_XCB_RENDER_HAS_FILTERS | CAIRO_XCB_RENDER_HAS_FILTER_GOOD | CAIRO_XCB_RENDER_HAS_FILTER_BEST | CAIRO_XCB_RENDER_HAS_PDF_OPERATORS | CAIRO_XCB_RENDER_HAS_EXTENDED_REPEAT | CAIRO_XCB_RENDER_HAS_GRADIENTS ) ; } else { xcb_render_query_version_reply_t version ; version . major_version = major_version ; version . minor_version = minor_version ; if ( ! XCB_RENDER_HAS_FILL_RECTANGLES ( & version ) ) connection -> flags &= ~ CAIRO_XCB_RENDER_HAS_FILL_RECTANGLES ; if ( ! XCB_RENDER_HAS_TRAPEZOIDS ( & version ) ) connection -> flags &= ~ CAIRO_XCB_RENDER_HAS_COMPOSITE_TRAPEZOIDS ; if ( ! XCB_RENDER_HAS_PICTURE_TRANSFORM ( & version ) ) connection -> flags &= ~ CAIRO_XCB_RENDER_HAS_PICTURE_TRANSFORM ; if ( ! XCB_RENDER_HAS_FILTERS ( & version ) ) connection -> flags &= ~ CAIRO_XCB_RENDER_HAS_FILTERS ; if ( ! XCB_RENDER_HAS_PDF_OPERATORS ( & version ) ) connection -> flags &= ~ CAIRO_XCB_RENDER_HAS_PDF_OPERATORS ; if ( ! XCB_RENDER_HAS_EXTENDED_REPEAT ( & version ) ) connection -> flags &= ~ CAIRO_XCB_RENDER_HAS_EXTENDED_REPEAT ; if ( ! XCB_RENDER_HAS_GRADIENTS ( & version ) ) connection -> flags &= ~ CAIRO_XCB_RENDER_HAS_GRADIENTS ; } }
cairo_xcb_device_debug_cap_xrender_version:
 @device: a #cairo_device_t for the XCB backend
 @major_version: major version to restrict to
 @minor_version: minor version to restrict to
cairo_xcb_device_debug_cap_xrender_version : @device : a #cairo_device_t for the XCB backend @major_version : major version to restrict to @minor_version : minor version to restrict to
/* First reset all the RENDER flags to their original value. This works
     * because we only ever clear bits after the connection was created.
     */ /* clear any flags that are inappropriate for the desired version */