summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qioscontext.mm
diff options
context:
space:
mode:
authorMaciej Kujalowicz <maciej.kujalowicz@trismer.com>2013-10-30 13:01:21 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-05 15:40:14 +0100
commit450d3efcb11da21e1c4f206dc57aeaddf10a1e70 (patch)
tree701eb0e7e50015fc95ee448c09d9a6aa36fa4e82 /src/plugins/platforms/ios/qioscontext.mm
parentaa6a0cdbf584eacdbf81b28cca97cc40200f6b6b (diff)
iOS: Enable threaded OpenGL.
This change activates ThreadedOpenGL and ThreadedPixmaps capabilities in the iOS integration. QIOSContext is expanded with a support for a shared context. Change-Id: I56615c870a24e17850ad2748421c54e015de3ab2 Reviewed-by: Ian Dean <ian@mediator-software.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios/qioscontext.mm')
-rw-r--r--src/plugins/platforms/ios/qioscontext.mm15
1 files changed, 14 insertions, 1 deletions
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<QIOSContext *>(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"