diff options
author | Brian Paul <[email protected]> | 2011-11-10 18:00:24 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-11-11 07:13:00 -0700 |
commit | 6e9b1d5d0d53a409085511c4e71f6098a5b36ce1 (patch) | |
tree | 2120e58b67c1874660f49afab127f872c1f64a79 /src/mesa | |
parent | 16bff7e2cec06b340e0c7c5dd935c53353f289b0 (diff) |
xlib: set alpha to 0xff when mapping RGB pixmaps
Fixes a bunch of conform regressions.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/x11/xm_buffer.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index 6cf9f068f22..ea87b6dfd0a 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -477,6 +477,17 @@ 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 */ |