summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2013-02-22 19:01:40 -0800
committerIan Romanick <ian.d.romanick@intel.com>2013-03-05 14:57:09 -0800
commit049f343e8ace0057ab5f8218a5c130632964ef71 (patch)
tree9ca350a2994caec851bd744718132e86a096fd81
parent0b494917b18d8cc5156bc97c2ce4c9024ddc4406 (diff)
egl: Allow 24-bit visuals for 32-bit RGBA8888 configs
Previously only the 32-bit X visual would match the 32-bit RGBA8888 configs. This resulted in every config with alpha getting the "magic" visual whose alpha is used by the compositor. This also resulted in no multisample visuals being advertised. How many ways could we lose? This patch inverts the problem... now you can't get the visual with alpha used by the compositor even if you want it. I think we need to invent a new value for EGL_TRANSPARENT_TYPE that apps can use to get this. I'm surprised that there isn't already a choice for EGL_TRANSPARENT_ALPHA. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Tested-by: Tian Ye <yex.tian@intel.com> Acked-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59783 (cherry picked from commit 68a147e9a9e8f171d9aacdc7d78d2107009c4741)
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 351fbf48278..e17d5befbba 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -195,7 +195,14 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
for (i = 0; attr_list[i] != EGL_NONE; i += 2)
_eglSetConfigKey(&base, attr_list[i], attr_list[i+1]);
- if (depth > 0 && depth != base.BufferSize)
+ /* Allow a 24-bit RGB visual to match a 32-bit RGBA EGLConfig. Otherwise
+ * it will only match a 32-bit RGBA visual. On a composited window manager
+ * on X11, this will make all of the EGLConfigs with destination alpha get
+ * blended by the compositor. This is probably not what the application
+ * wants... especially on drivers that only have 32-bit RGBA EGLConfigs!
+ */
+ if (depth > 0 && depth != base.BufferSize
+ && !(depth == 24 && base.BufferSize == 32))
return NULL;
if (rgba_masks && memcmp(rgba_masks, dri_masks, sizeof(dri_masks)))