diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2014-12-03 16:56:17 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2014-12-04 13:46:59 +0100 |
commit | 198d7a51d4fc894fca691c1f8243372e876af68a (patch) | |
tree | 48183281fe15fb053afd5f837b6d9eeb15c7f7e2 /src/client/qwaylandnativeinterface.cpp | |
parent | 6b8b6b80a1852c1e4d0a626129d4382d11423a54 (diff) | |
download | qtwayland-198d7a51d4fc894fca691c1f8243372e876af68a.tar.gz |
Enable Qt WebEngine on Wayland
The native resource getters that are supported by eglfs will have to be
supported by the wayland platform plugin too. (on wayland-egl at least)
Change-Id: Ibbab649c04785dbde177342c45b9bc6f1edd954d
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/client/qwaylandnativeinterface.cpp')
-rw-r--r-- | src/client/qwaylandnativeinterface.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/client/qwaylandnativeinterface.cpp b/src/client/qwaylandnativeinterface.cpp index 3d714c2f..fca176ac 100644 --- a/src/client/qwaylandnativeinterface.cpp +++ b/src/client/qwaylandnativeinterface.cpp @@ -49,6 +49,7 @@ #include "qwaylandscreen_p.h" #include <QtGui/private/qguiapplication_p.h> #include <QtGui/QScreen> +#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h> QT_BEGIN_NAMESPACE @@ -61,13 +62,16 @@ void *QWaylandNativeInterface::nativeResourceForIntegration(const QByteArray &re { QByteArray lowerCaseResource = resourceString.toLower(); - if (lowerCaseResource == "display" || lowerCaseResource == "wl_display") + if (lowerCaseResource == "display" || lowerCaseResource == "wl_display" || lowerCaseResource == "nativedisplay") return m_integration->display()->wl_display(); if (lowerCaseResource == "compositor") return const_cast<wl_compositor *>(m_integration->display()->wl_compositor()); if (lowerCaseResource == "server_buffer_integration") return m_integration->serverBufferIntegration(); + if (lowerCaseResource == "egldisplay" && m_integration->clientBufferIntegration()) + return m_integration->clientBufferIntegration()->nativeResource(QWaylandClientBufferIntegration::EglDisplay); + return 0; } @@ -96,6 +100,22 @@ void *QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc return NULL; } +void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) +{ + QByteArray lowerCaseResource = resource.toLower(); + + if (lowerCaseResource == "eglconfig" && m_integration->clientBufferIntegration()) + return m_integration->clientBufferIntegration()->nativeResourceForContext(QWaylandClientBufferIntegration::EglConfig, context->handle()); + + if (lowerCaseResource == "eglcontext" && m_integration->clientBufferIntegration()) + return m_integration->clientBufferIntegration()->nativeResourceForContext(QWaylandClientBufferIntegration::EglContext, context->handle()); + + if (lowerCaseResource == "egldisplay" && m_integration->clientBufferIntegration()) + return m_integration->clientBufferIntegration()->nativeResourceForContext(QWaylandClientBufferIntegration::EglDisplay, context->handle()); + + return 0; +} + QVariantMap QWaylandNativeInterface::windowProperties(QPlatformWindow *window) const { QWaylandWindow *waylandWindow = static_cast<QWaylandWindow *>(window); |