diff options
author | Hal Gentz <[email protected]> | 2019-10-10 18:35:50 -0600 |
---|---|---|
committer | Adam Jackson <[email protected]> | 2019-10-11 21:57:21 +0000 |
commit | 90a19074b4e1d4d8f8ababaade8170c05aeecffe (patch) | |
tree | 78803ff106d46c0fd627e643887c1011ec57b721 /src/egl/main | |
parent | 173bc9d6842efdec54ea3fd415a6946dcee7b02a (diff) |
egl: Fixes transparency with EGL and X11.
This commit does this by allowing both RGB and RGBA visuals to match with
EGL configs. We also expose the `EGL_MESA_config_select_group` egl
extension, which is similar to GLX's visual select group extension, to
allow the RGBA visuals to get less priority.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67676
Fixes: 049f343e8ac "egl: Allow 24-bit visuals for 32-bit RGBA8888 configs"
Cc: [email protected]
Reviewed-by: Adam Jackson <[email protected]>
Signed-off-by: Hal Gentz <[email protected]>
Diffstat (limited to 'src/egl/main')
-rw-r--r-- | src/egl/main/eglconfig.c | 9 | ||||
-rw-r--r-- | src/egl/main/eglconfig.h | 2 | ||||
-rw-r--r-- | src/egl/main/eglglobals.c | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index 0a95e8ee05d..b3362363664 100644 --- a/src/egl/main/eglconfig.c +++ b/src/egl/main/eglconfig.c @@ -258,6 +258,9 @@ static const struct { { EGL_COLOR_COMPONENT_TYPE_EXT, ATTRIB_TYPE_ENUM, ATTRIB_CRITERION_EXACT, EGL_COLOR_COMPONENT_TYPE_FIXED_EXT }, + { EGL_CONFIG_SELECT_GROUP_MESA, ATTRIB_TYPE_INTEGER, + ATTRIB_CRITERION_IGNORE, + 0 }, }; @@ -296,6 +299,8 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching) if (val > 1 || val < 0) valid = EGL_FALSE; break; + case EGL_CONFIG_SELECT_GROUP_MESA: + break; default: if (val < 0) valid = EGL_FALSE; @@ -608,6 +613,10 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2, if (conf1 == conf2) return 0; + val1 = conf1->ConfigSelectGroup - conf2->ConfigSelectGroup; + if (val1) + return val1; + /* the enum values have the desired ordering */ STATIC_ASSERT(EGL_NONE < EGL_SLOW_CONFIG); STATIC_ASSERT(EGL_SLOW_CONFIG < EGL_NON_CONFORMANT_CONFIG); diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h index 605289de536..064187ff1dd 100644 --- a/src/egl/main/eglconfig.h +++ b/src/egl/main/eglconfig.h @@ -89,6 +89,7 @@ struct _egl_config EGLint FramebufferTargetAndroid; EGLint RecordableAndroid; EGLint ComponentType; + EGLint ConfigSelectGroup; }; @@ -139,6 +140,7 @@ _eglOffsetOfConfig(EGLint attr) ATTRIB_MAP(EGL_FRAMEBUFFER_TARGET_ANDROID, FramebufferTargetAndroid); ATTRIB_MAP(EGL_RECORDABLE_ANDROID, RecordableAndroid); ATTRIB_MAP(EGL_COLOR_COMPONENT_TYPE_EXT, ComponentType); + ATTRIB_MAP(EGL_CONFIG_SELECT_GROUP_MESA, ConfigSelectGroup); #undef ATTRIB_MAP default: return -1; diff --git a/src/egl/main/eglglobals.c b/src/egl/main/eglglobals.c index 0d7270333ec..71d1fccf75f 100644 --- a/src/egl/main/eglglobals.c +++ b/src/egl/main/eglglobals.c @@ -70,7 +70,8 @@ struct _egl_global _eglGlobal = " EGL_EXT_device_query" " EGL_EXT_platform_base" " EGL_KHR_client_get_all_proc_addresses" - " EGL_KHR_debug", + " EGL_KHR_debug" + " EGL_MESA_config_select_group", .PlatformExtensionString = #ifdef HAVE_WAYLAND_PLATFORM |