From 30e950515171b25d9bc3da8d535cfe05d8be69c8 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 29 Jan 2013 02:49:26 +0000 Subject: [PATCH] xlib/shm: Skip creating new SHM segments if the data is already in the xserver If the image is already inside a SHM segment, but the image format does not match the surface, fallback to the XRender paths in order to perform colorspace conversion on the data already inside the Xserver. Signed-off-by: Chris Wilson --- src/cairo-xlib-render-compositor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cairo-xlib-render-compositor.c b/src/cairo-xlib-render-compositor.c index 94abe9ee3..10360dbec 100644 --- a/src/cairo-xlib-render-compositor.c +++ b/src/cairo-xlib-render-compositor.c @@ -250,6 +250,10 @@ draw_image_boxes (void *_dst, cairo_int_status_t status; int i; + if (image->base.device == dst->base.device && + image->depth != dst->depth) + return CAIRO_INT_STATUS_UNSUPPORTED; + if (image->base.device == dst->base.device && image->depth == dst->depth && _cairo_xlib_shm_surface_get_pixmap (&image->base))