summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2014-12-06 17:04:07 +0100
committerUli Schlachter <psychon@znc.in>2015-01-17 20:12:39 +0100
commitebd23accc8722db838f6db12f7489f16fe6016ce (patch)
treef70f60f84ddc7aae9cece4c4fa58489973095c19
parentb47209a03feeed2172f35a6d79ba1176fedd5e17 (diff)
xlib-xcb: Don't be lazy and use the real xcb_screen_t
Signed-off-by: Uli Schlachter <psychon@znc.in>
-rw-r--r--src/cairo-xlib-xcb-surface.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/cairo-xlib-xcb-surface.c b/src/cairo-xlib-xcb-surface.c
index 9c0d4b413..af3e15578 100644
--- a/src/cairo-xlib-xcb-surface.c
+++ b/src/cairo-xlib-xcb-surface.c
@@ -519,21 +519,6 @@ cairo_xlib_surface_create (Display *dpy,
width, height));
}
-cairo_surface_t *
-cairo_xlib_surface_create_for_bitmap (Display *dpy,
- Pixmap bitmap,
- Screen *scr,
- int width,
- int height)
-{
- return _cairo_xlib_xcb_surface_create (dpy, scr, NULL, NULL,
- cairo_xcb_surface_create_for_bitmap (XGetXCBConnection (dpy),
- (xcb_screen_t *) scr,
- bitmap,
- width, height));
-}
-
-#if CAIRO_HAS_XLIB_XRENDER_SURFACE
static xcb_screen_t *
_cairo_xcb_screen_from_root (xcb_connection_t *connection,
xcb_window_t id)
@@ -548,6 +533,24 @@ _cairo_xcb_screen_from_root (xcb_connection_t *connection,
return NULL;
}
+
+cairo_surface_t *
+cairo_xlib_surface_create_for_bitmap (Display *dpy,
+ Pixmap bitmap,
+ Screen *scr,
+ int width,
+ int height)
+{
+ xcb_connection_t *connection = XGetXCBConnection (dpy);
+ xcb_screen_t *screen = _cairo_xcb_screen_from_root (connection, (xcb_window_t) scr->root);
+ return _cairo_xlib_xcb_surface_create (dpy, scr, NULL, NULL,
+ cairo_xcb_surface_create_for_bitmap (connection,
+ screen,
+ bitmap,
+ width, height));
+}
+
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
cairo_surface_t *
cairo_xlib_surface_create_with_xrender_format (Display *dpy,
Drawable drawable,