diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-23 15:37:37 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-23 15:40:42 +0200 |
commit | 8ab2f3d9bdf1119cc13567c9dd2c74879c0b0ee4 (patch) | |
tree | e3e0ef844725d8b9d79626b98a60cd94a20ebcda /src/plugins/platforms/xcb/qxcbnativeinterface.cpp | |
parent | 90ac74c771b55dd6f8a9700e28278be446d8dd0d (diff) |
Get declarative and wayland EGL backend working for Qt compositor.
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbnativeinterface.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 45823fcc57..28b62b3aec 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -73,6 +73,21 @@ public: Q_GLOBAL_STATIC(QXcbResourceMap, qXcbResourceMap) +void *QXcbNativeInterface::nativeResourceForContext(const QByteArray &resourceString, QGuiGLContext *context) +{ + QByteArray lowerCaseResource = resourceString.toLower(); + ResourceType resource = qXcbResourceMap()->value(lowerCaseResource); + void *result = 0; + switch(resource) { + case EglContext: + result = eglContextForContext(context); + break; + default: + result = 0; + } + return result; +} + void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) { QByteArray lowerCaseResource = resourceString.toLower(); @@ -94,9 +109,6 @@ void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceStr case GraphicsDevice: result = graphicsDeviceForWindow(window); break; - case EglContext: - result = eglContextForWindow(window); - break; default: result = 0; } @@ -161,8 +173,13 @@ void *QXcbNativeInterface::graphicsDeviceForWindow(QWindow *window) } -void * QXcbNativeInterface::eglContextForWindow(QWindow *window) +void * QXcbNativeInterface::eglContextForContext(QGuiGLContext *context) { + Q_ASSERT(context); +#if defined(XCB_USE_EGL) + QEGLPlatformContext *eglPlatformContext = static_cast<QEGLPlatformContext *>(context->handle()); + return eglPlatformContext->eglContext(); +#endif #if 0 Q_ASSERT(window); QPlatformGLContext *platformContext = window->glContext()->handle(); |