summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Arne Petersen <jan.petersen@kdab.com>2013-07-08 09:37:17 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-06 15:53:07 +0200
commitfe375dc3d0ae28df6d929a5f86fd0a162a898853 (patch)
tree34493dbec636a61a04a5fae32122c0964ffe0db9 /src
parentba77bb34ddee7f9434abae61e6f75c3d3a8e2cf9 (diff)
eglfs: Implement nativeResourceForWindow
Add support to request EglDisplay resource for a window. This is supported in other platform plugins, like kms and xcb and is required by wayland-egl based QtWayland compositors. Change-Id: If3f8c625682915c9671e820974e810763c3c8b66 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.cpp14
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
index 33427c45fa..08f68a20f4 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
@@ -202,6 +202,20 @@ void *QEglFSIntegration::nativeResourceForIntegration(const QByteArray &resource
return 0;
}
+void *QEglFSIntegration::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
+{
+ QByteArray lowerCaseResource = resource.toLower();
+
+ if (lowerCaseResource == "egldisplay") {
+ if (window)
+ return static_cast<QEglFSScreen *>(window->handle()->screen())->display();
+ else
+ return static_cast<QEglFSScreen *>(mScreen)->display();
+ }
+
+ return 0;
+}
+
void *QEglFSIntegration::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
{
QByteArray lowerCaseResource = resource.toLower();
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h
index c01b6db456..dd85788bd8 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.h
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.h
@@ -72,6 +72,7 @@ public:
// QPlatformNativeInterface
void *nativeResourceForIntegration(const QByteArray &resource);
+ void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) Q_DECL_OVERRIDE;
void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context);
NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE;