summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/kms
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@theqtcompany.com>2014-12-19 17:12:41 +0100
committerJørgen Lind <jorgen.lind@theqtcompany.com>2014-12-22 21:38:35 +0100
commitf9f54bc0e46e6abc88316e653347036994e2eba9 (patch)
tree23ed408039feb2b4df1b4b9e6220e37b7274fddd /src/plugins/platforms/kms
parentbf86735f073aaf61278230708b92c5193c5f9e15 (diff)
Add some missing nativeResourceForIntegration imlementations
The EglDisplay and the Display is normally a PlatformIntegration wide resource Change-Id: Ie5382a2a0b34fbe1c506b5134bf581afbd7f5d99 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/kms')
-rw-r--r--src/plugins/platforms/kms/qkmsnativeinterface.cpp24
-rw-r--r--src/plugins/platforms/kms/qkmsnativeinterface.h2
2 files changed, 25 insertions, 1 deletions
diff --git a/src/plugins/platforms/kms/qkmsnativeinterface.cpp b/src/plugins/platforms/kms/qkmsnativeinterface.cpp
index 3ed1643fdb..c133b48086 100644
--- a/src/plugins/platforms/kms/qkmsnativeinterface.cpp
+++ b/src/plugins/platforms/kms/qkmsnativeinterface.cpp
@@ -52,6 +52,21 @@ public:
Q_GLOBAL_STATIC(QKmsResourceMap, qKmsResourceMap)
+void *QKmsNativeInterface::nativeResourceForIntegration(const QByteArray &resourceString)
+{
+ QByteArray lowerCaseResource = resourceString.toLower();
+ ResourceType resource = qKmsResourceMap()->value(lowerCaseResource);
+ void *result = 0;
+ switch (resource) {
+ case EglDisplay:
+ result = eglDisplay();
+ break;
+ default:
+ result = 0;
+ }
+ return result;
+
+}
void *QKmsNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window)
{
QByteArray lowerCaseResource = resourceString.toLower();
@@ -79,7 +94,14 @@ QPlatformNativeInterface::NativeResourceForContextFunction QKmsNativeInterface::
return 0;
}
-
+void *QKmsNativeInterface::eglDisplay()
+{
+ //QKmsIntegration *integration = static_cast<QKmsIntegration *>(QGuiApplicationPrivate::platformIntegration());
+ QKmsScreen *screen = static_cast<QKmsScreen *>(QGuiApplication::primaryScreen()->handle());
+ if (!screen || !screen->device())
+ return 0;
+ return screen->device()->eglDisplay();
+}
void *QKmsNativeInterface::eglDisplayForWindow(QWindow *window)
{
diff --git a/src/plugins/platforms/kms/qkmsnativeinterface.h b/src/plugins/platforms/kms/qkmsnativeinterface.h
index 2b22231ace..402c8b7f6f 100644
--- a/src/plugins/platforms/kms/qkmsnativeinterface.h
+++ b/src/plugins/platforms/kms/qkmsnativeinterface.h
@@ -46,10 +46,12 @@ public:
EglContext
};
+ void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE;
void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE;
NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE;
+ void *eglDisplay();
void *eglDisplayForWindow(QWindow *window);
void *eglContextForWindow(QWindow *window);
static void *eglContextForContext(QOpenGLContext *context);