diff options
Diffstat (limited to 'src/hardwareintegration/client/wayland-egl')
5 files changed, 17 insertions, 9 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp index 596911ad3..6bd2f76e3 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; @@ -143,7 +147,7 @@ bool QWaylandEglClientBufferIntegration::supportsWindowDecoration() const QWaylandWindow *QWaylandEglClientBufferIntegration::createEglWindow(QWindow *window) { - return new QWaylandEglWindow(window); + return new QWaylandEglWindow(window, m_display); } QPlatformOpenGLContext *QWaylandEglClientBufferIntegration::createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp index 030422c56..e8d43fad4 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -54,8 +54,8 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -QWaylandEglWindow::QWaylandEglWindow(QWindow *window) - : QWaylandWindow(window) +QWaylandEglWindow::QWaylandEglWindow(QWindow *window, QWaylandDisplay *display) + : QWaylandWindow(window, display) , m_clientBufferIntegration(static_cast<QWaylandEglClientBufferIntegration *>(mDisplay->clientBufferIntegration())) { QSurfaceFormat fmt = window->requestedFormat(); diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h index 9e6cb876c..878532afc 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h @@ -56,7 +56,7 @@ class QWaylandEglWindow : public QWaylandWindow { Q_OBJECT public: - QWaylandEglWindow(QWindow *window); + QWaylandEglWindow(QWindow *window, QWaylandDisplay *display); ~QWaylandEglWindow(); WindowType windowType() const override; void ensureSize() override; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 5bd2760d0..137a189e1 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -49,12 +49,12 @@ #include <QDebug> #include <QtEglSupport/private/qeglconvenience_p.h> #include <QtGui/private/qopenglcontext_p.h> -#include <QtGui/private/qopengltexturecache_p.h> +#include <QtOpenGL/private/qopengltexturecache_p.h> #include <QtGui/private/qguiapplication_p.h> #include <qpa/qplatformopenglcontext.h> #include <QtGui/QSurfaceFormat> -#include <QtGui/QOpenGLShaderProgram> +#include <QtOpenGL/QOpenGLShaderProgram> #include <QtGui/QOpenGLFunctions> #include <QOpenGLBuffer> @@ -312,7 +312,7 @@ QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *dis // Create an EGL context for the decorations blitter. By using a dedicated context we don't need to make sure to not // change the context state and we also use OpenGL ES 2 API independently to what the app is using to draw. - QVector<EGLint> eglDecorationsContextAttrs = { EGL_CONTEXT_CLIENT_VERSION, 1, EGL_NONE }; + QVector<EGLint> eglDecorationsContextAttrs = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; m_decorationsContext = eglCreateContext(m_eglDisplay, m_config, m_context, eglDecorationsContextAttrs.constData()); if (m_decorationsContext == EGL_NO_CONTEXT) qWarning("QWaylandGLContext: Failed to create the decorations EGLContext. Decorations will not be drawn."); @@ -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 diff --git a/src/hardwareintegration/client/wayland-egl/wayland-egl.pri b/src/hardwareintegration/client/wayland-egl/wayland-egl.pri index d7634b150..1a80e7cab 100644 --- a/src/hardwareintegration/client/wayland-egl/wayland-egl.pri +++ b/src/hardwareintegration/client/wayland-egl/wayland-egl.pri @@ -2,7 +2,7 @@ INCLUDEPATH += $$PWD QMAKE_USE += egl wayland-client wayland-egl -QT += egl_support-private +QT += egl_support-private opengl-private SOURCES += $$PWD/qwaylandeglclientbufferintegration.cpp \ $$PWD/qwaylandglcontext.cpp \ |