diff options
author | Florent Revest <revestflo@gmail.com> | 2018-02-22 16:37:57 +0100 |
---|---|---|
committer | Pier Luigi Fiorini <pierluigi.fiorini@liri.io> | 2018-05-15 10:59:20 +0000 |
commit | 7a6cecc91982792c8a830241b921733f30768fcd (patch) | |
tree | 165839a1c61b0ac6858909ee41af8baaf7b8ce0d /src | |
parent | 687cf7c7d1d2f809de56787e16c73a4eb64766fc (diff) |
brcm-egl: Add native resources handlers to the client integration
This is needed for QtWebEngine's EGL integration when ran as a Wayland
client on Broadcom platforms.
Task-number: QTBUG-67415
Change-Id: I4ef05073f0b3d9a08570322341fa3b8ef92cdf52
Co-authored-by: Dominik Holland <dominik.holland@pelagicore.com>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp | 27 | ||||
-rw-r--r-- | src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h | 3 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp index 4478b9fdf..cd0f285cd 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp @@ -124,6 +124,33 @@ EGLDisplay QWaylandBrcmEglIntegration::eglDisplay() const return m_eglDisplay; } +void *QWaylandBrcmEglIntegration::nativeResource(NativeResource resource) +{ + switch (resource) { + case EglDisplay: + return m_eglDisplay; + default: + break; + } + return nullptr; +} + +void *QWaylandBrcmEglIntegration::nativeResourceForContext(NativeResource resource, QPlatformOpenGLContext *context) +{ + Q_ASSERT(context); + switch (resource) { + case EglConfig: + return static_cast<QWaylandBrcmGLContext *>(context)->eglConfig(); + case EglContext: + return static_cast<QWaylandBrcmGLContext *>(context)->eglContext(); + case EglDisplay: + return m_eglDisplay; + default: + break; + } + return nullptr; +} + } QT_END_NAMESPACE diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h index 651400d87..5e8a3bf46 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h @@ -82,6 +82,9 @@ public: PFNEGLCREATEGLOBALIMAGEBRCMPROC eglCreateGlobalImageBRCM; PFNEGLDESTROYGLOBALIMAGEBRCMPROC eglDestroyGlobalImageBRCM; + void *nativeResource(NativeResource resource) override; + void *nativeResourceForContext(NativeResource resource, QPlatformOpenGLContext *context) override; + private: static void wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); |