summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-03-27 21:11:45 -0600
committerBrian <[email protected]>2008-03-27 21:11:45 -0600
commit5935b16ff5d8cbe07c97f2990e281a9c5986d0a1 (patch)
treea2dcda7c28312727ed57d938c0f6f33b613b67ed /src/gallium
parent39038c11699bbc9baab744542e96d54e91cb452a (diff)
If visual is 32bpp, set visual->alphaBits = 8.
This works since we always use XImages for color buffers. It wouldn't always work for Windows/Pixmaps.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/winsys/xlib/xm_api.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/winsys/xlib/xm_api.c b/src/gallium/winsys/xlib/xm_api.c
index 6b46327e21f..a82d3c990e7 100644
--- a/src/gallium/winsys/xlib/xm_api.c
+++ b/src/gallium/winsys/xlib/xm_api.c
@@ -511,6 +511,14 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b,
return GL_FALSE;
}
v->mesa_visual.indexBits = 0;
+
+ if (v->BitsPerPixel == 32) {
+ /* We use XImages for all front/back buffers. If an X Window or
+ * X Pixmap is 32bpp, there's no guarantee that the alpha channel
+ * will be preserved. For XImages we're in luck.
+ */
+ v->mesa_visual.alphaBits = 8;
+ }
}
/*