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 <Ross.Alexander@EU.NEC.COM>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Uli Schlachter 2010-10-05 19:40:52 +02:00 committed by Chris Wilson
parent da62cc21da
commit e6ce65fb82

View file

@ -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)