diff options
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfsintegration.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 257c3cd3dc..a62d3bdaed 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -47,6 +47,7 @@ #include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h> #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h> +#include <QtPlatformSupport/private/qeglplatformcontext_p.h> #include <qpa/qplatformwindow.h> #include <QtGui/QSurfaceFormat> @@ -130,4 +131,34 @@ QVariant QEglFSIntegration::styleHint(QPlatformIntegration::StyleHint hint) cons return QPlatformIntegration::styleHint(hint); } +QPlatformNativeInterface *QEglFSIntegration::nativeInterface() const +{ + return const_cast<QEglFSIntegration *>(this); +} + +void *QEglFSIntegration::nativeResourceForIntegration(const QByteArray &resource) +{ + QByteArray lowerCaseResource = resource.toLower(); + + if (lowerCaseResource == "egldisplay") + return static_cast<QEglFSScreen *>(mScreen)->display(); + + return 0; +} + +void *QEglFSIntegration::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) +{ + QByteArray lowerCaseResource = resource.toLower(); + + QEGLPlatformContext *handle = static_cast<QEGLPlatformContext *>(context->handle()); + + if (!handle) + return 0; + + if (lowerCaseResource == "eglcontext") + return handle->eglContext(); + + return 0; +} + QT_END_NAMESPACE |