egl: Detect Windows platform using GDI

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
This commit is contained in:
Jesse Natalie
2021-09-08 12:54:17 -07:00
committed by Marge Bot
parent 58389dd55f
commit 06e95693fb

View File

@@ -64,6 +64,9 @@
#ifdef HAVE_DRM_PLATFORM
#include <gbm.h>
#endif
#ifdef HAVE_WINDOWS_PLATFORM
#include <windows.h>
#endif
/**
@@ -128,6 +131,11 @@ _eglNativePlatformDetectNativeDisplay(void *nativeDisplay)
if (nativeDisplay == EGL_DEFAULT_DISPLAY)
return _EGL_INVALID_PLATFORM;
#ifdef HAVE_WINDOWS_PLATFORM
if (GetObjectType(nativeDisplay) == OBJ_DC)
return _EGL_PLATFORM_WINDOWS;
#endif
#if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM)
if (_eglPointerIsDereferencable(nativeDisplay)) {
void *first_pointer = *(void **) nativeDisplay;