Mesa (master): xlib: use MESA_FORMAT_XRGB8888 for pixmap surfaces

Brian Paul brianp at kemper.freedesktop.org
Tue Nov 15 14:55:24 UTC 2011


Module: Mesa
Branch: master
Commit: c9bfad2921904780d982917def276a6979a5debd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c9bfad2921904780d982917def276a6979a5debd

Author: Brian Paul <brianp at vmware.com>
Date:   Sat Nov 12 11:50:31 2011 -0700

xlib: use MESA_FORMAT_XRGB8888 for pixmap surfaces

We no longer have software-allocated alpha buffers so we can forget
about the alpha channel.

Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/drivers/x11/xm_buffer.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c
index ea87b6d..cd059fc 100644
--- a/src/mesa/drivers/x11/xm_buffer.c
+++ b/src/mesa/drivers/x11/xm_buffer.c
@@ -349,7 +349,7 @@ xmesa_new_renderbuffer(struct gl_context *ctx, GLuint name,
          /* This will really only happen for pixmaps.  We'll access the
           * pixmap via a temporary XImage which will be 32bpp.
           */
-         xrb->Base.Format = MESA_FORMAT_ARGB8888;
+         xrb->Base.Format = MESA_FORMAT_XRGB8888;
          break;
       case PF_8A8R8G8B:
          xrb->Base.Format = MESA_FORMAT_ARGB8888;
@@ -477,17 +477,6 @@ xmesa_MapRenderbuffer(struct gl_context *ctx,
             return;
          }
 
-         if (xrb->Base.Format == MESA_FORMAT_ARGB8888 ||
-             xrb->Base.Format == MESA_FORMAT_RGBA8888_REV) {
-            /* The original pixmap is RGB but we're returning an RGBA
-             * image buffer.  Fill in the A values with 0xff.
-             */
-            GLuint i, *p = (GLuint *) ximage->data;
-            for (i = 0; i < w * h; i++) {
-               p[i] |= 0xff000000;
-            }
-         }
-
          xrb->map_ximage = ximage;
 
          /* the first row of the OpenGL image is last row of the XImage */




More information about the mesa-commit mailing list