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>
This commit is contained in:
parent
3e4f885f0c
commit
d2bffe0fc9
@ -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");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user