drisw: Fix 24bpp software rendering, take 2
authorMarc Pignat <marc@pignat.org>
Tue, 28 Jun 2011 13:21:58 +0000 (15:21 +0200)
committerBrian Paul <brianp@vmware.com>
Fri, 15 Jul 2011 16:09:14 +0000 (10:09 -0600)
This patch add the support for 24bpp in the dri/swrast implementation.
See http://bugs.freedesktop.org/show_bug.cgi?id=23525

Signed-off-by: Marc Pignat <marc at pignat.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
src/glx/drisw_glx.c

index d0137ee65177938ed10525d6956f74a8b9175966..7bd64506ee8ed2074066be373391409b4fba468c 100644 (file)
@@ -100,6 +100,13 @@ XCreateDrawable(struct drisw_drawable * pdp,
                               32,                     /* bitmap_pad */
                               0);                     /* bytes_per_line */
 
+  /**
+   * swrast does not handle 24-bit depth with 24 bpp, so let X do the
+   * the conversion for us.
+   */
+  if (pdp->ximage->bits_per_pixel == 24)
+     pdp->ximage->bits_per_pixel = 32;
+
    return True;
 }