diff options
author | Ravi Nanjundappa <nravi.n@samsung.com> | 2014-07-02 14:13:58 +0530 |
---|---|---|
committer | Bryce Harrington <b.harrington@samsung.com> | 2014-07-07 03:53:13 -0700 |
commit | be62b1221169469c8923a5a1ec669761f5344c57 (patch) | |
tree | 89ca8c72093f85ee6cbd23e97eeebe78e605ff22 /src/cairo-xcb-private.h | |
parent | 550385fb004e6064305518cf265adc03bd2d0c0b (diff) | |
download | cairo-be62b1221169469c8923a5a1ec669761f5344c57.tar.gz |
xcb: make use of _cairo_surface_is_xcb to check for surface type
Introduced a new inline function _cairo_surface_is_xcb() as similar to
_cairo_surface_is_image() and used the same to check for xcb surface
type
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Diffstat (limited to 'src/cairo-xcb-private.h')
-rw-r--r-- | src/cairo-xcb-private.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cairo-xcb-private.h b/src/cairo-xcb-private.h index 5f048035e..134100a7b 100644 --- a/src/cairo-xcb-private.h +++ b/src/cairo-xcb-private.h @@ -267,6 +267,21 @@ enum { cairo_private extern const cairo_surface_backend_t _cairo_xcb_surface_backend; +/** + * _cairo_surface_is_xcb: + * @surface: a #cairo_surface_t + * + * Checks if a surface is an #cairo_xcb_surface_t + * + * Return value: %TRUE if the surface is an xcb surface + **/ +static inline cairo_bool_t +_cairo_surface_is_xcb (const cairo_surface_t *surface) +{ + /* _cairo_surface_nil sets a NULL backend so be safe */ + return surface->backend && surface->backend->type == CAIRO_SURFACE_TYPE_XCB; +} + cairo_private cairo_xcb_connection_t * _cairo_xcb_connection_get (xcb_connection_t *connection); |