diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-06-16 16:28:20 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2016-06-17 13:18:33 +0000 |
commit | d2bffe0fc9461f7cbbaf639bfc76050f4de8a46f (patch) | |
tree | 9213481d9a3a31cc49a2b25b3a5cfc33e9603bac | |
parent | 3e4f885f0c8f9d4e951241459d310ed977936806 (diff) |
UIKit: Detect swapBuffers on non-exposed windows and skip flush
When using threaded rendering the render-thread might be half-way into
rendering a frame when the application is backgrounded, resulting in
the following swap happening on a non-exposed window. This may result
in the system killing the application, as rendering is not supposed to
happen when an application is backgrounded, so we skip the flush.
Change-Id: I9ab8f2c4617391fd827558af9fb473f1734b3688
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
-rw-r--r-- | src/plugins/platforms/ios/qioscontext.mm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm index e76a2b9902..eeb07b2796 100644 --- a/src/plugins/platforms/ios/qioscontext.mm +++ b/src/plugins/platforms/ios/qioscontext.mm @@ -211,6 +211,11 @@ void QIOSContext::swapBuffers(QPlatformSurface *surface) if (surface->surface()->surfaceClass() == QSurface::Offscreen) return; // Nothing to do + if (!static_cast<QIOSWindow *>(surface)->isExposed()) { + qCWarning(lcQpaGLContext, "Detected swapBuffers on a non-exposed window, skipping flush"); + return; + } + FramebufferObject &framebufferObject = backingFramebufferObjectFor(surface); Q_ASSERT_X(framebufferObject.isComplete, "QIOSContext", "swapBuffers on incomplete FBO"); |