diff options
author | Uli Schlachter <psychon@znc.in> | 2011-09-03 14:09:58 +0200 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2011-09-14 15:21:37 +0200 |
commit | af11d26752d73b5530f84478da7cc14a80cd9421 (patch) | |
tree | 1fc9999cd4a8bb1bb327d8be347b5aef593aee89 /src/cairo-xcb-surface.c | |
parent | cd69c8ef68496f6c6c78e375f831a81ac99c12e4 (diff) | |
download | cairo-af11d26752d73b5530f84478da7cc14a80cd9421.tar.gz |
xcb: Remove some dead code
surface->use_pixmap always had the value 0. This code is taken from cairo-xlib.
However, in cairo-xlib use_pixmap is set to 20 if XGetImage() fails.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src/cairo-xcb-surface.c')
-rw-r--r-- | src/cairo-xcb-surface.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c index fe4d62863..67568bd39 100644 --- a/src/cairo-xcb-surface.c +++ b/src/cairo-xcb-surface.c @@ -362,18 +362,13 @@ _get_image (cairo_xcb_surface_t *surface, } } - if (surface->use_pixmap == 0) { - status = _cairo_xcb_connection_get_image (connection, - surface->drawable, - x, y, - width, height, - &reply); - if (unlikely (status)) - goto FAIL; - } else { - surface->use_pixmap--; - reply = NULL; - } + status = _cairo_xcb_connection_get_image (connection, + surface->drawable, + x, y, + width, height, + &reply); + if (unlikely (status)) + goto FAIL; if (reply == NULL && ! surface->owns_pixmap) { /* xcb_get_image_t from a window is dangerous because it can @@ -381,6 +376,10 @@ _get_image (cairo_xcb_surface_t *surface, * outside the screen. We could check for errors and * retry, but to keep things simple, we just create a * temporary pixmap + * + * If we hit this fallback too often, we should remember so and + * skip the round-trip from the above GetImage request, + * similar to what cairo-xlib does. */ xcb_pixmap_t pixmap; xcb_gcontext_t gc; @@ -915,7 +914,6 @@ _cairo_xcb_surface_create_internal (cairo_xcb_screen_t *screen, surface->drawable = drawable; surface->owns_pixmap = owns_pixmap; - surface->use_pixmap = 0; surface->deferred_clear = FALSE; surface->deferred_clear_color = *CAIRO_COLOR_TRANSPARENT; |