Skip to content

Commit

Permalink
xcb: Correctly handle ARGB visuals
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Uli Schlachter authored and Chris Wilson committed Oct 13, 2010
1 parent da62cc2 commit e6ce65f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cairo-xcb-surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e6ce65f

Please sign in to comment.