diff --git a/src/plugins/platforms/ios/qioscontext.h b/src/plugins/platforms/ios/qioscontext.h index 082ec4794c..961661c5d3 100644 --- a/src/plugins/platforms/ios/qioscontext.h +++ b/src/plugins/platforms/ios/qioscontext.h @@ -66,10 +66,14 @@ public: GLuint defaultFramebufferObject(QPlatformSurface *) const; QFunctionPointer getProcAddress(const QByteArray &procName); + bool isSharing() const Q_DECL_OVERRIDE; + bool isValid() const Q_DECL_OVERRIDE; + private Q_SLOTS: void windowDestroyed(QObject *object); private: + QIOSContext *m_sharedContext; EAGLContext *m_eaglContext; QSurfaceFormat m_format; diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm index 0c4bee1ef0..d7b9314ae0 100644 --- a/src/plugins/platforms/ios/qioscontext.mm +++ b/src/plugins/platforms/ios/qioscontext.mm @@ -51,7 +51,10 @@ QIOSContext::QIOSContext(QOpenGLContext *context) : QPlatformOpenGLContext() - , m_eaglContext([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]) + , m_sharedContext(static_cast(context->shareHandle())) + , m_eaglContext([[EAGLContext alloc] + initWithAPI:kEAGLRenderingAPIOpenGLES2 + sharegroup:m_sharedContext ? [m_sharedContext->m_eaglContext sharegroup] : nil]) , m_format(context->format()) { m_format.setRenderableType(QSurfaceFormat::OpenGLES); @@ -203,5 +206,15 @@ QFunctionPointer QIOSContext::getProcAddress(const QByteArray& functionName) return QFunctionPointer(dlsym(RTLD_DEFAULT, functionName.constData())); } +bool QIOSContext::isValid() const +{ + return m_eaglContext; +} + +bool QIOSContext::isSharing() const +{ + return m_sharedContext; +} + #include "moc_qioscontext.cpp" diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm index dcad6121be..393a9f317d 100644 --- a/src/plugins/platforms/ios/qiosintegration.mm +++ b/src/plugins/platforms/ios/qiosintegration.mm @@ -102,6 +102,9 @@ bool QIOSIntegration::hasCapability(Capability cap) const { switch (cap) { case OpenGL: + case ThreadedOpenGL: + return true; + case ThreadedPixmaps: return true; case MultipleWindows: return true;