From c6d7f9c1a091b516bcd18178e3eb2719b1ba3e4e Mon Sep 17 00:00:00 2001 From: Jorgen Lind Date: Thu, 5 Jul 2012 13:59:22 +0200 Subject: Implement nativeResourceFunctionForContext for xcb Change-Id: Icf6c39fb456b39fec58ac2f74c569b9d01993589 Reviewed-by: Gunnar Sletta --- src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 9 +++++++++ src/plugins/platforms/xcb/qxcbnativeinterface.h | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index cc00d0845e..a6647da8be 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -133,6 +133,15 @@ void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceStr return result; } +QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface::nativeResourceFunctionForContext(const QByteArray &resource) +{ + QByteArray lowerCaseResource = resource.toLower(); + if (lowerCaseResource == "get_egl_context") { + return eglContextForContext; + } + return 0; +} + QPlatformNativeInterface::EventFilter QXcbNativeInterface::setEventFilter(const QByteArray &eventType, QPlatformNativeInterface::EventFilter filter) { int type = -1; diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h index 354ef76799..8221d9a36b 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.h +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h @@ -71,6 +71,8 @@ public: void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context); void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window); + NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource); + inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } EventFilter setEventFilter(const QByteArray &eventType, EventFilter filter); EventFilter eventFilter(EventFilterType type) const { return m_eventFilters[type]; } @@ -80,8 +82,7 @@ public: void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *graphicsDeviceForWindow(QWindow *window); - - void *eglContextForContext(QOpenGLContext *context); + static void *eglContextForContext(QOpenGLContext *context); private: const QByteArray m_genericEventFilterType; -- cgit v1.2.3