_EGLPlatformType
_eglGetNativePlatform(void *nativeDisplay)
{
- static _EGLPlatformType native_platform;
- char *detection_method;
-
- native_platform = _eglGetNativePlatformFromEnv();
- detection_method = "environment overwrite";
+ static _EGLPlatformType native_platform = _EGL_INVALID_PLATFORM;
if (native_platform == _EGL_INVALID_PLATFORM) {
- native_platform = _eglNativePlatformDetectNativeDisplay(nativeDisplay);
- detection_method = "autodetected";
- }
+ const char *detection_method;
- if (native_platform == _EGL_INVALID_PLATFORM) {
- native_platform = _EGL_NATIVE_PLATFORM;
- detection_method = "build-time configuration";
- }
+ native_platform = _eglGetNativePlatformFromEnv();
+ detection_method = "environment overwrite";
- _eglLog(_EGL_DEBUG, "Native platform type: %s (%s)",
- egl_platforms[native_platform].name, detection_method);
+ 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";
+ }
+
+ _eglLog(_EGL_DEBUG, "Native platform type: %s (%s)",
+ egl_platforms[native_platform].name, detection_method);
+ }
return native_platform;
}