diff options
author | Uli Schlachter <psychon@znc.in> | 2011-07-21 15:41:25 +0200 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2011-07-21 16:51:26 +0200 |
commit | 7c2ccef3eb636661ee45c501c8345b6bde9a827c (patch) | |
tree | e05e281d92a309a75f8522abf80d062550f1339a /src/cairo-xcb-connection.c | |
parent | 83df0ab2b6ccaf623303b606a99303b5d054b145 (diff) | |
download | cairo-7c2ccef3eb636661ee45c501c8345b6bde9a827c.tar.gz |
xcb: Make it possible to undo _cairo_xcb_device_debug_cap_*
We now remember the original flags before any call to
cairo_xcb_device_debug_cap_xshm_version() or
cairo_xcb_device_debug_cap_xrender_version() was done and re-set these flags on
any new call to these functions. This makes it possible to raise e.g. the used
RENDER version again.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src/cairo-xcb-connection.c')
-rw-r--r-- | src/cairo-xcb-connection.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cairo-xcb-connection.c b/src/cairo-xcb-connection.c index 19d546295..84876de52 100644 --- a/src/cairo-xcb-connection.c +++ b/src/cairo-xcb-connection.c @@ -673,6 +673,8 @@ _cairo_xcb_connection_get (xcb_connection_t *xcb_connection) } #endif + connection->original_flags = connection->flags; + CAIRO_MUTEX_UNLOCK (connection->device.mutex); cairo_list_add (&connection->link, &connections); @@ -780,6 +782,11 @@ cairo_xcb_device_debug_cap_xshm_version (cairo_device_t *device, 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); @@ -812,6 +819,11 @@ cairo_xcb_device_debug_cap_xrender_version (cairo_device_t *device, 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 | |