diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-11-21 17:16:27 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-22 22:36:48 +0100 |
commit | c38225229d047eeb52a09150dff9985f0547b13f (patch) | |
tree | 89c290f478eaa112d1b1e4795b1a05e1523f13c8 /src/plugins | |
parent | c25385ae1e3da0848c2718a002ae7d037f25db94 (diff) |
iOS: Allow QBackingStore::flush() without beginPaint()
The QBackingStore API doesn't require clients to precede flush() with a
beginPaint() call, but our backingstore is backed by a GL context, so
it's up to us to ensure it's current before swapping.
Change-Id: Ia6119bf0e835448b1fd383d933df6f88fa4f298a
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/ios/qiosbackingstore.mm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qiosbackingstore.mm b/src/plugins/platforms/ios/qiosbackingstore.mm index 2dadc5672b..80b603bb8e 100644 --- a/src/plugins/platforms/ios/qiosbackingstore.mm +++ b/src/plugins/platforms/ios/qiosbackingstore.mm @@ -56,6 +56,9 @@ QIOSBackingStore::QIOSBackingStore(QWindow *window) fmt.setDepthBufferSize(16); fmt.setStencilBufferSize(8); + // Needed to prevent QOpenGLContext::makeCurrent() from failing + window->setSurfaceType(QSurface::OpenGLSurface); + m_context->setFormat(fmt); m_context->setScreen(window->screen()); m_context->create(); @@ -69,9 +72,6 @@ QIOSBackingStore::~QIOSBackingStore() void QIOSBackingStore::beginPaint(const QRegion &) { - // Needed to prevent QOpenGLContext::makeCurrent() from failing - window()->setSurfaceType(QSurface::OpenGLSurface); - m_context->makeCurrent(window()); QIOSWindow *iosWindow = static_cast<QIOSWindow *>(window()->handle()); @@ -102,6 +102,8 @@ void QIOSBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoin // the child window overlaps a sibling window that's draws using a separate QOpenGLContext. return; } + + m_context->makeCurrent(window); m_context->swapBuffers(window); } |