From 5599abf6259998f312289f8c2ae48e5ea54ac2d7 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 30 Sep 2020 17:01:24 +0200 Subject: Make sure beforeFrameBegin-afterFrameEnd always come in pairs With some platforms there is no valid window size yet when the render thread hits syncAndRender (of course, it does not actually render then). In this case we emitted an afterFrameEnd without a corresponding beforeFrameBegin. Just make sure both signal emissions are under the same condition. This is tested by the frameSignals case in tst_qquickwindow but since that's not exercised with the threaded render loop by the CI atm, the fail was not noticed. Change-Id: I300ffcc117daa4c6163ce15dd60ceffba659bd69 Reviewed-by: Andy Nichols --- src/quick/scenegraph/qsgthreadedrenderloop.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/quick/scenegraph') diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index bdd0d20d64..fca2cfb5fa 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -825,7 +825,10 @@ void QSGRenderThread::syncAndRender(QImage *grabImage) qCDebug(QSG_LOG_RENDERLOOP, QSG_RT_PAD, "- rendering done"); - emit window->afterFrameEnd(); + // beforeFrameBegin - afterFrameEnd must always come in pairs; if there was + // no before due to 0 size then there shouldn't be an after either + if (current) + emit window->afterFrameEnd(); // Though it would be more correct to put this block directly after // fireFrameSwapped in the if (current) branch above, we don't do -- cgit v1.2.3