diff options
author | James McDonnell <jmcdonnell@blackberry.com> | 2019-12-05 12:12:37 -0500 |
---|---|---|
committer | James McDonnell <jmcdonnell@blackberry.com> | 2020-01-13 11:50:21 -0500 |
commit | 5a66bc64b0b157929c9fc76f0f4ae046393be600 (patch) | |
tree | 982af2ecd7f8d64cca36e4390b485ebe381eee12 /src/hardwareintegration | |
parent | da13b1b130f520ee0bd9df0e9190db64a2ea4a93 (diff) |
Enable QtWayland for QNX
Make EGL 1.5 with EGL_PLATFORM_WAYLAND_EXT a requirement for QNX and
add some EGL 1.5 code alternatives. Avoids the need to deal with
incompatibility problems between the QNX native display/window type
and Wayland display/window type.
Change-Id: Ib26a020e1f8c7f570c6af08697d8c8153c887294
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Dan Cape <dcape@qnx.com>
Diffstat (limited to 'src/hardwareintegration')
3 files changed, 13 insertions, 1 deletions
diff --git a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp index 754196468..42c85f7db 100644 --- a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp +++ b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp @@ -125,7 +125,11 @@ void DrmEglServerBufferIntegration::initializeEgl() return; m_egl_initialized = true; +#if defined(EGL_VERSION_1_5) && defined(EGL_PLATFORM_WAYLAND_EXT) + m_egl_display = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, m_display->wl_display(), nullptr); +#else m_egl_display = eglGetDisplay((EGLNativeDisplayType) m_display->wl_display()); +#endif if (m_egl_display == EGL_NO_DISPLAY) { qWarning("Failed to initialize drm egl server buffer integration. Could not get egl display from wl_display."); return; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp index 0dc389bb8..6f0b57fcd 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp @@ -76,6 +76,9 @@ QWaylandEglClientBufferIntegration::~QWaylandEglClientBufferIntegration() void QWaylandEglClientBufferIntegration::initialize(QWaylandDisplay *display) { +#if defined(EGL_VERSION_1_5) && defined(EGL_PLATFORM_WAYLAND_EXT) + m_eglDisplay = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, display->wl_display(), nullptr); +#else if (q_hasEglExtension(EGL_NO_DISPLAY, "EGL_EXT_platform_base")) { if (q_hasEglExtension(EGL_NO_DISPLAY, "EGL_KHR_platform_wayland") || q_hasEglExtension(EGL_NO_DISPLAY, "EGL_EXT_platform_wayland") || @@ -98,6 +101,7 @@ void QWaylandEglClientBufferIntegration::initialize(QWaylandDisplay *display) m_eglDisplay = eglGetDisplay((EGLNativeDisplayType) display->wl_display()); } +#endif m_display = display; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 7679a5fb3..8ea8e1092 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -346,7 +346,11 @@ void QWaylandGLContext::updateGLFormat() wl_surface *wlSurface = m_display->createSurface(nullptr); wl_egl_window *eglWindow = wl_egl_window_create(wlSurface, 1, 1); - EGLSurface eglSurface = eglCreateWindowSurface(m_eglDisplay, m_config, eglWindow, 0); +#if defined(EGL_VERSION_1_5) + EGLSurface eglSurface = eglCreatePlatformWindowSurface(m_eglDisplay, m_config, eglWindow, nullptr); +#else + EGLSurface eglSurface = eglCreateWindowSurface(m_eglDisplay, m_config, eglWindow, nullptr); +#endif if (eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) { if (m_format.renderableType() == QSurfaceFormat::OpenGL |