aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgthreadedrenderloop.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2022-01-24 20:05:04 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2022-01-31 13:41:39 +0100
commit8d3ba425ae7a571e3311cdb2e71324dfd037de76 (patch)
tree775a88d660b19ed3a033f0c36b167e1000d9e9b3 /src/quick/scenegraph/qsgthreadedrenderloop.cpp
parentef8bd8544752d966a575cc9f0e16f4ddab8dbecc (diff)
Reset the bad-vsync counters on window resize
OpenGL implementations such as NVIDIA on Windows (but presumably others as well) break the presentation rate when resizing a window. D3D and Vulkan would stick closely to the normal rate. In any case, resetting the counters on a resize is a good idea because we do not really care about inconsistencies during a resize. Change-Id: I173daf8a7aefca3d24779102b9354c923478d424 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgthreadedrenderloop.cpp')
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 743ff3b009..e79d21dcb1 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -1151,6 +1151,17 @@ void QSGThreadedRenderLoop::hide(QQuickWindow *window)
releaseResources(window);
}
+void QSGThreadedRenderLoop::resize(QQuickWindow *window)
+{
+ qCDebug(QSG_LOG_RENDERLOOP) << "reisze()" << window;
+
+ Window *w = windowFor(m_windows, window);
+ if (!w)
+ return;
+
+ w->psTimeAccumulator = 0.0f;
+ w->psTimeSampleCount = 0;
+}
/*
If the window is first hide it, then perform a complete cleanup