diff options
author | Samuli Piippo <samuli.piippo@qt.io> | 2020-02-26 16:14:30 +0200 |
---|---|---|
committer | Samuli Piippo <samuli.piippo@qt.io> | 2020-03-05 08:19:05 +0200 |
commit | 7458370a6facf4261df90eea7230382756608a2e (patch) | |
tree | 0176e9ab23c667495faea50cc8db56b2fae95a61 | |
parent | 9bea5d5cb8f48bd5602e1a45cf8817f7e5f320c8 (diff) | |
download | qtwayland-7458370a6facf4261df90eea7230382756608a2e.tar.gz |
Test the EGL wayland platform extensions before using them
The Khronos headers may be recent enough to have the ifdefs but
implementation might still be missing on some platforms.
Don't use the extensions unless the configure test passes.
Change-Id: I23129115729567fa92bc23da099d27df598fc206
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
4 files changed, 10 insertions, 5 deletions
diff --git a/src/client/configure.json b/src/client/configure.json index 9b8b4345..73f23362 100644 --- a/src/client/configure.json +++ b/src/client/configure.json @@ -231,9 +231,14 @@ "condition": "features.wayland-client", "output": [ "privateFeature" ] }, + "egl-extension-platform-wayland": { + "label": "EGL wayland platform extension", + "condition": "features.wayland-client && features.opengl && features.egl && tests.egl_1_5-wayland", + "output": [ "privateFeature" ] + }, "wayland-egl": { "label": "EGL", - "condition": "features.wayland-client && features.opengl && features.egl && libs.wayland-egl && (!config.qnx || tests.egl_1_5-wayland)", + "condition": "features.wayland-client && features.opengl && features.egl && libs.wayland-egl && (!config.qnx || features.egl-extension-platform-wayland)", "output": [ "privateFeature" ] }, "wayland-brcm": { @@ -253,7 +258,7 @@ }, "wayland-drm-egl-server-buffer": { "label": "DRM EGL", - "condition": "features.wayland-client && features.opengl && features.egl && tests.drm-egl-server && (!config.qnx || tests.egl_1_5-wayland)", + "condition": "features.wayland-client && features.opengl && features.egl && tests.drm-egl-server && (!config.qnx || features.egl-extension-platform-wayland)", "output": [ "privateFeature" ] }, "wayland-libhybris-egl-server-buffer": { diff --git a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp index 42c85f7d..bb2532fb 100644 --- a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp +++ b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp @@ -125,7 +125,7 @@ void DrmEglServerBufferIntegration::initializeEgl() return; m_egl_initialized = true; -#if defined(EGL_VERSION_1_5) && defined(EGL_PLATFORM_WAYLAND_EXT) +#if QT_CONFIG(egl_extension_platform_wayland) m_egl_display = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, m_display->wl_display(), nullptr); #else m_egl_display = eglGetDisplay((EGLNativeDisplayType) m_display->wl_display()); diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp index 6f0b57fc..a1df046c 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp @@ -76,7 +76,7 @@ QWaylandEglClientBufferIntegration::~QWaylandEglClientBufferIntegration() void QWaylandEglClientBufferIntegration::initialize(QWaylandDisplay *display) { -#if defined(EGL_VERSION_1_5) && defined(EGL_PLATFORM_WAYLAND_EXT) +#if QT_CONFIG(egl_extension_platform_wayland) m_eglDisplay = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, display->wl_display(), nullptr); #else if (q_hasEglExtension(EGL_NO_DISPLAY, "EGL_EXT_platform_base")) { diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 8ea8e109..02affe31 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -346,7 +346,7 @@ void QWaylandGLContext::updateGLFormat() wl_surface *wlSurface = m_display->createSurface(nullptr); wl_egl_window *eglWindow = wl_egl_window_create(wlSurface, 1, 1); -#if defined(EGL_VERSION_1_5) +#if QT_CONFIG(egl_extension_platform_wayland) EGLSurface eglSurface = eglCreatePlatformWindowSurface(m_eglDisplay, m_config, eglWindow, nullptr); #else EGLSurface eglSurface = eglCreateWindowSurface(m_eglDisplay, m_config, eglWindow, nullptr); |