diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-30 17:01:24 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-10-02 16:28:49 +0200 |
commit | 5599abf6259998f312289f8c2ae48e5ea54ac2d7 (patch) | |
tree | 0d983e05da98302b032ed337d2e23d06d08b8cb0 /src/quick | |
parent | 10e6c7edc7aa5ed563ae55602c5f6aef9846cfce (diff) |
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 <andy.nichols@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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 |