From e6ce65fb82c2df09330f31fd9251fdf96f0cab50 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Tue, 5 Oct 2010 19:40:52 +0200 Subject: [PATCH] xcb: Correctly handle ARGB visuals We want surface->depth to end up as "32", so we have to invent an alpha mask. This mask is not used anyway (only its popcount), but still this should get a less ugly fix. This was found because "assert (reply->depth == surface->depth);" in _get_image() failed. Original-patch-by: Ross Alexander Signed-off-by: Uli Schlachter Signed-off-by: Chris Wilson --- src/cairo-xcb-surface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c index d852f509f..656e58929 100644 --- a/src/cairo-xcb-surface.c +++ b/src/cairo-xcb-surface.c @@ -1177,6 +1177,9 @@ cairo_xcb_surface_create (xcb_connection_t *xcb_connection, image_masks.red_mask = visual->red_mask; image_masks.green_mask = visual->green_mask; image_masks.blue_mask = visual->blue_mask; + if (depth == 32) /* XXX visuals have no alpha! */ + image_masks.alpha_mask = + 0xffffffff & ~(visual->red_mask | visual->green_mask | visual->blue_mask); if (depth > 16) image_masks.bpp = 32; else if (depth > 8)