diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-05-04 10:56:02 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-05-07 07:13:04 +0000 |
commit | e46b6db98631804c4c2a79af764190c98c408fb7 (patch) | |
tree | f617ee5fa5df56baed4c9148c6d497c593ab4a50 /src/plugins/platforms/ios/qiosintegration.mm | |
parent | fe1fb593ae52fa3e4069826f123cc9fe6705e92d (diff) |
ios: Add support for QOpenGLWidget and QQuickWidget
The global shared context is now always enabled on iOS. This means that
contexts used by QOpenGLWindow/Widget and QQuickWindow/Widget and the
iOS backingstore will share with each other.
[ChangeLog][QtGui] QOpenGLWidget and QQuickWidget are now supported on iOS.
Task-number: QTBUG-40034
Change-Id: Ibfb99ffcb18f8f8d263662fbf237bc348fc730ee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/ios/qiosintegration.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiosintegration.mm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm index 7cd4280f5e..837d0e9143 100644 --- a/src/plugins/platforms/ios/qiosintegration.mm +++ b/src/plugins/platforms/ios/qiosintegration.mm @@ -77,6 +77,15 @@ QIOSIntegration::QIOSIntegration() "'applicationDidFinishLaunching' inside your UIApplication delegate.\n"); } + // The backingstore needs a global share context in order to support composition in + // QPlatformBackingStore. + qApp->setAttribute(Qt::AA_ShareOpenGLContexts, true); + // And that context must match the format used for the backingstore's context. + QSurfaceFormat fmt; + fmt.setDepthBufferSize(16); + fmt.setStencilBufferSize(8); + QSurfaceFormat::setDefaultFormat(fmt); + // Set current directory to app bundle folder QDir::setCurrent(QString::fromUtf8([[[NSBundle mainBundle] bundlePath] UTF8String])); @@ -137,6 +146,8 @@ bool QIOSIntegration::hasCapability(Capability cap) const return false; case ApplicationState: return true; + case RasterGLSurface: + return true; default: return QPlatformIntegration::hasCapability(cap); } |