summaryrefslogtreecommitdiff
path: root/src/cairo-xcb-connection-shm.c
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2012-09-25 11:12:58 +0200
committerUli Schlachter <psychon@znc.in>2012-09-25 11:27:59 +0200
commitb33d83ad49343ce226f76ceb6c83659c72442e91 (patch)
tree7cd3ac37ac7a7d6fea685372efb16ad445227fde /src/cairo-xcb-connection-shm.c
parentde31018bdd1cc78fd54cf9fd7b220117008c33a8 (diff)
downloadcairo-b33d83ad49343ce226f76ceb6c83659c72442e91.tar.gz
xcb: Verify extension support before sending
This commit adds lots of asserts. These asserts verify for each extension request that we send that the server really supports this. Sadly, this causes 28 assertion failures in the test suite with xcb-render-0.0. Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src/cairo-xcb-connection-shm.c')
-rw-r--r--src/cairo-xcb-connection-shm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cairo-xcb-connection-shm.c b/src/cairo-xcb-connection-shm.c
index 2ba95831b..8c1d50698 100644
--- a/src/cairo-xcb-connection-shm.c
+++ b/src/cairo-xcb-connection-shm.c
@@ -44,6 +44,7 @@ _cairo_xcb_connection_shm_attach (cairo_xcb_connection_t *connection,
cairo_bool_t readonly)
{
uint32_t segment = _cairo_xcb_connection_get_xid (connection);
+ assert (connection->flags & CAIRO_XCB_HAS_SHM);
xcb_shm_attach (connection->xcb_connection, segment, id, readonly);
return segment;
}
@@ -64,6 +65,7 @@ _cairo_xcb_connection_shm_put_image (cairo_xcb_connection_t *connection,
uint32_t shm,
uint32_t offset)
{
+ assert (connection->flags & CAIRO_XCB_HAS_SHM);
xcb_shm_put_image (connection->xcb_connection, dst, gc, total_width, total_height,
src_x, src_y, width, height, dst_x, dst_y, depth,
XCB_IMAGE_FORMAT_Z_PIXMAP, 0, shm, offset);
@@ -82,6 +84,7 @@ _cairo_xcb_connection_shm_get_image (cairo_xcb_connection_t *connection,
xcb_shm_get_image_reply_t *reply;
xcb_generic_error_t *error;
+ assert (connection->flags & CAIRO_XCB_HAS_SHM);
reply = xcb_shm_get_image_reply (connection->xcb_connection,
xcb_shm_get_image (connection->xcb_connection,
src,
@@ -106,6 +109,7 @@ void
_cairo_xcb_connection_shm_detach (cairo_xcb_connection_t *connection,
uint32_t segment)
{
+ assert (connection->flags & CAIRO_XCB_HAS_SHM);
xcb_shm_detach (connection->xcb_connection, segment);
_cairo_xcb_connection_put_xid (connection, segment);
}