From 508990af8d83c83ae6ea0c3e66bd736d3446027d Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 8 Jul 2011 21:31:47 +0200 Subject: xcb: Don't use xcb surfaces as snapshots Eventually someone might try to paint to the xcb surface again. However, _cairo_surface_begin_modification doesn't like that: cairo-surface.c:385: _cairo_surface_begin_modification: Assertion `surface->snapshot_of == ((void *)0)' failed. There was only a single place in the xcb backend where a cairo_xcb_surface_t could be used as a snapshot, so the _cairo_surface_has_snapshot that checked for such a surface can be removed, too. This does *not* remove all snapshots from the xcb backend, but all the remaining snapshots are instances of cairo_xcb_picture_t. These surfaces are only ever created internally and thus can't be modified by users directly. Fixes: xcb-snapshot-assert Signed-off-by: Uli Schlachter --- src/cairo-xcb-surface-render.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c index e8d6c52d..4f4b1dc9 100644 --- a/src/cairo-xcb-surface-render.c +++ b/src/cairo-xcb-surface-render.c @@ -1016,17 +1016,6 @@ _cairo_xcb_surface_picture (cairo_xcb_surface_t *target, cairo_xcb_picture_t *picture; cairo_filter_t filter; - { - cairo_xcb_surface_t *snapshot; - - snapshot = (cairo_xcb_surface_t *) - _cairo_surface_has_snapshot (source, &_cairo_xcb_surface_backend); - if (snapshot != NULL) { - if (snapshot->screen == target->screen) - source = &snapshot->base; - } - } - picture = (cairo_xcb_picture_t *) _cairo_surface_has_snapshot (source, &_cairo_xcb_picture_backend); if (picture != NULL) { @@ -2532,17 +2521,6 @@ _upload_image_inplace (cairo_xcb_surface_t *surface, if (pattern->surface->type != CAIRO_SURFACE_TYPE_IMAGE) return CAIRO_INT_STATUS_UNSUPPORTED; - { - cairo_xcb_surface_t *snapshot; - - snapshot = (cairo_xcb_surface_t *) - _cairo_surface_has_snapshot (pattern->surface, &_cairo_xcb_surface_backend); - if (snapshot != NULL) { - if (snapshot->screen == surface->screen) - return CAIRO_INT_STATUS_UNSUPPORTED; - } - } - { cairo_xcb_picture_t *snapshot; @@ -2609,12 +2587,6 @@ _upload_image_inplace (cairo_xcb_surface_t *surface, _cairo_xcb_screen_put_gc (surface->screen, image->depth, gc); _cairo_xcb_connection_release (surface->connection); - if (surface->width == image->width && surface->height == image->height && - extents->width == image->width && extents->height == image->height) - { - _cairo_surface_attach_snapshot (&image->base, &surface->base, NULL); - } - return CAIRO_STATUS_SUCCESS; } -- cgit v1.2.3