mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 15:48:00 +02:00
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>
This commit is contained in:
parent
cd69c8ef68
commit
af11d26752
2 changed files with 11 additions and 14 deletions
|
|
@ -94,7 +94,6 @@ struct _cairo_xcb_surface {
|
|||
|
||||
xcb_drawable_t drawable;
|
||||
cairo_bool_t owns_pixmap;
|
||||
int use_pixmap;
|
||||
|
||||
cairo_bool_t deferred_clear;
|
||||
cairo_color_t deferred_clear_color;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue