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>
This commit is contained in:
parent
ab56b7a11f
commit
a40ad12ef2
@ -69,6 +69,14 @@ public:
|
||||
|
||||
virtual QWaylandWindow *createEglWindow(QWindow *window) = 0;
|
||||
virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0;
|
||||
|
||||
enum NativeResource {
|
||||
EglDisplay,
|
||||
EglConfig,
|
||||
EglContext
|
||||
};
|
||||
virtual void *nativeResource(NativeResource /*resource*/) { return Q_NULLPTR; }
|
||||
virtual void *nativeResourceForContext(NativeResource /*resource*/, QPlatformOpenGLContext */*context*/) { return Q_NULLPTR; }
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -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);
|
||||
|
@ -61,6 +61,7 @@ public:
|
||||
QWindow *window);
|
||||
void *nativeResourceForScreen(const QByteArray &resourceString,
|
||||
QScreen *screen);
|
||||
void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context);
|
||||
|
||||
QVariantMap windowProperties(QPlatformWindow *window) const;
|
||||
QVariant windowProperty(QPlatformWindow *window, const QString &name) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user