summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSvenn-Arne Dragly <s@dragly.com>2018-02-07 19:52:00 +0100
committerSvenn-Arne Dragly <svenn-arne.dragly@qt.io>2018-02-09 08:28:03 +0000
commit370201c3afdbe976a988a6bb840cce832c719f93 (patch)
tree5287d2f6be17bf04aa6793c1e4d255749d5526e9
parent352dacc0040f77345ab2f6e9019ff68ba2ed354e (diff)
Proceed to the next frame even if we cannot lock the surface
Previously, if the render surface could not be locked or makeCurrent failed, the aspect thread would be stuck waiting for the next frame and the render thread would be stuck waiting for the render jobs. This change makes sure both threads continue, which will allow changes to the surface to be synchronized and make the render thread try to lock the surface again. Task-number: QTBUG-66243 Change-Id: I01bbe4c2ca74961f363efbe87c0586edaad41c62 Reviewed-by: Harald Vistnes <harald.vistnes@gmail.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r--src/render/backend/renderer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/render/backend/renderer.cpp b/src/render/backend/renderer.cpp
index 8fa68191d..0b975a3d3 100644
--- a/src/render/backend/renderer.cpp
+++ b/src/render/backend/renderer.cpp
@@ -621,6 +621,11 @@ void Renderer::lockSurfaceAndRender()
if (!createSurfaceLockAndMakeCurrent()) {
m_surfaceLockers.clear();
abortRenderJobs();
+ // We cannot render because we could not lock the surface or the surface is a nullptr.
+ // However, the surface might change in the next frontend/backend sync.
+ // We therefore need to make sure the aspect thread does not get stuck waiting for
+ // the next frame.
+ m_vsyncFrameAdvanceService->proceedToNextFrame();
return;
}
// Let the aspect thread know that we promise to render