for (depths = xcb_screen_allowed_depths_iterator (screens.data);
depths.rem;
xcb_depth_next (&depths))
{
missing &= ~DEPTH_MASK (depths.data->depth);
} if (missing == 0) continue;
/* * Ok, this is ugly. It should be sufficient at this * point to just return false, but Xinerama is broken at * this point and only advertises depths which have an * associated visual. Of course, the other depths still * work, but the only way to find out is to try them.
*/ if (! pixmap_depths_usable (connection, missing, screens.data->root)) returnFALSE;
}
if (! present || version == NULL || formats == NULL) {
free (version);
free (formats); return CAIRO_STATUS_SUCCESS;
}
/* always true if the extension is present (i.e. >= 0.0) */
connection->flags |= CAIRO_XCB_HAS_RENDER;
connection->flags |= CAIRO_XCB_RENDER_HAS_COMPOSITE;
connection->flags |= CAIRO_XCB_RENDER_HAS_COMPOSITE_GLYPHS;
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_FILTER_GOOD (version))
connection->flags |= CAIRO_XCB_RENDER_HAS_FILTER_GOOD;
if (XCB_RENDER_HAS_FILTER_BEST (version))
connection->flags |= CAIRO_XCB_RENDER_HAS_FILTER_BEST;
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;
if (XCB_RENDER_HAS_SUBPIXEL_ORDER (version)) {
uint32_t screen;
uint32_t *subpixel = xcb_render_query_pict_formats_subpixels(formats);
/* The spec explicitly allows to have too few entries in the reply... */ for (screen = 0; screen < formats->num_subpixel && screen < connection->root->roots_len; screen++)
connection->subpixel_orders[screen] = subpixel[screen];
}
free (version);
status = _cairo_xcb_connection_parse_xrender_formats (connection, formats);
free (formats);
#if CAIRO_HAS_XCB_SHM_FUNCTIONS /* _cairo_xcb_screen_finish finishes surfaces. If any of those surfaces had
* a fallback image, we might have done a SHM PutImage. */
_cairo_xcb_connection_shm_mem_pools_flush (connection); #endif
key.hash = visual;
format = _cairo_hash_table_lookup (connection->visual_to_xrender_format, &key); return format ? format->xrender_format : XCB_NONE;
}
/** * cairo_xcb_device_get_connection: * @device: a #cairo_device_t for the XCB backend * * Get the connection for the XCB device. * * Returns: the #xcb_connection_t for the connection * * Since: 1.12
**/
xcb_connection_t *
cairo_xcb_device_get_connection (cairo_device_t *device)
{ if (device->backend->type != CAIRO_DEVICE_TYPE_XCB) return NULL;
/** * cairo_xcb_device_debug_cap_xshm_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 SHM extension. This function exists solely for debugging purpose. * It let's you find out how cairo would behave with an older version of * the SHM extension. * * Use the special values -1 and -1 for disabling the SHM extension. * * Since: 1.12
**/ void
cairo_xcb_device_debug_cap_xshm_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 SHM 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_SHM_MASK);
/* clear any flags that are inappropriate for the desired version */ if (major_version < 0 && minor_version < 0) {
connection->flags &= ~(CAIRO_XCB_HAS_SHM);
}
}
/** * 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
**/ 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;
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_set_precision: * @device: a #cairo_device_t for the XCB backend * @precision: the precision to use * * Render supports two modes of precision when rendering trapezoids. Set * the precision to the desired mode. * * Since: 1.12
**/ void
cairo_xcb_device_debug_set_precision (cairo_device_t *device, int precision)
{ if (device == NULL || device->status) return; 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;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.