Commit 7adb9b09 authored by Eric Engestrom's avatar Eric Engestrom Committed by Chad Versace

egl/display: remove unnecessary code and make it easier to read

Remove the two first level `if` as they will always be true, and
flatten the two remaining `if`.
No functional change.
Signed-off-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: default avatarChad Versace <chad.versace@intel.com>
parent 2e6d3580
......@@ -178,25 +178,24 @@ _eglNativePlatformDetectNativeDisplay(void *nativeDisplay)
_EGLPlatformType
_eglGetNativePlatform(void *nativeDisplay)
{
static _EGLPlatformType native_platform = _EGL_INVALID_PLATFORM;
char *detection_method = NULL;
static _EGLPlatformType native_platform;
char *detection_method;
native_platform = _eglGetNativePlatformFromEnv();
detection_method = "environment overwrite";
if (native_platform == _EGL_INVALID_PLATFORM) {
native_platform = _eglGetNativePlatformFromEnv();
detection_method = "environment overwrite";
if (native_platform == _EGL_INVALID_PLATFORM) {
native_platform = _eglNativePlatformDetectNativeDisplay(nativeDisplay);
detection_method = "autodetected";
if (native_platform == _EGL_INVALID_PLATFORM) {
native_platform = _EGL_NATIVE_PLATFORM;
detection_method = "build-time configuration";
}
}
native_platform = _eglNativePlatformDetectNativeDisplay(nativeDisplay);
detection_method = "autodetected";
}
if (native_platform == _EGL_INVALID_PLATFORM) {
native_platform = _EGL_NATIVE_PLATFORM;
detection_method = "build-time configuration";
}
if (detection_method != NULL)
_eglLog(_EGL_DEBUG, "Native platform type: %s (%s)",
egl_platforms[native_platform].name, detection_method);
_eglLog(_EGL_DEBUG, "Native platform type: %s (%s)",
egl_platforms[native_platform].name, detection_method);
return native_platform;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment