aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgrenderloop.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-07-01 15:10:36 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-07-01 15:44:56 +0200
commit721a4ec93334b22b7a9c5d505774a6f5248e4cc1 (patch)
tree40c2e759d11b546be167b3ef86669fff7113d326 /src/quick/scenegraph/qsgrenderloop.cpp
parent38e0b279d9c36d029918a2d86575050d13778d86 (diff)
Fix before/after frame signal emissions
Make the before signal closer to the actual QRhi::beginFrame() call. This fixes emitting a beforeFrameBegin unnecessarily when unexposing and then exposing a window again. Change-Id: Icc562a57798986c8d04c6800eabc41981c5da85b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgrenderloop.cpp')
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index c2c17508f1..9d1217edf9 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -596,8 +596,6 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
emit window->afterAnimating();
- emit window->beforeFrameBegin();
-
// Begin the frame before syncing -> sync is where we may invoke
// updatePaintNode() on the items and they may want to do resource updates.
// Also relevant for applications that connect to the before/afterSynchronizing
@@ -629,6 +627,8 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
}
}
+ emit window->beforeFrameBegin();
+
Q_ASSERT(rhi == cd->rhi);
// ### the flag should only be set when the app requests it, but there's no way to do that right now
QRhi::BeginFrameFlags frameFlags = QRhi::ExternalContentsInPass;
@@ -639,6 +639,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
else if (frameResult == QRhi::FrameOpError)
qWarning("Failed to start frame");
// out of date is not worth warning about - it may happen even during resizing on some platforms
+ emit window->afterFrameEnd();
return;
}
}