aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@sletta.org>2016-08-25 13:40:33 +0200
committerGunnar Sletta <gunnar@sletta.org>2016-11-09 06:58:07 +0000
commitc5cfce8553d591418f4752b62ac26f8b37e70515 (patch)
tree94204c275a8ee6a59de3e74fdd243afcebf49da1
parent020947fa30c72245f008bcaa9b76feee7f2d1c72 (diff)
Ensure windows renderloop doesn't stop existing, running, animations
If there is a normal C++ Qt animation running when the animation driver is installed, and we don't have a visible QQuickWindow at that time, the animation will await the QQuickWindow's vsync to be ticked (which might never happen). So don't install the driver until after we've registered started/stopped (which will be called by install) and when m_vsyncDelta is correctly initialized. Change-Id: If36633ba78d8b16afa658ae5279372158a4f7924 Task-number: QTBUG-55521 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/quick/scenegraph/qsgwindowsrenderloop.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
index 941a7b3f3c..2a2d8be657 100644
--- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp
+++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
@@ -84,18 +84,17 @@ QSGWindowsRenderLoop::QSGWindowsRenderLoop()
{
m_rc = static_cast<QSGDefaultRenderContext *>(m_sg->createRenderContext());
- m_animationDriver = m_sg->createAnimationDriver(m_sg);
- m_animationDriver->install();
-
- connect(m_animationDriver, SIGNAL(started()), this, SLOT(started()));
- connect(m_animationDriver, SIGNAL(stopped()), this, SLOT(stopped()));
-
m_vsyncDelta = 1000 / QGuiApplication::primaryScreen()->refreshRate();
if (m_vsyncDelta <= 0)
m_vsyncDelta = 16;
RLDEBUG("Windows Render Loop created");
+ m_animationDriver = m_sg->createAnimationDriver(m_sg);
+ connect(m_animationDriver, SIGNAL(started()), this, SLOT(started()));
+ connect(m_animationDriver, SIGNAL(stopped()), this, SLOT(stopped()));
+ m_animationDriver->install();
+
qsg_render_timer.start();
}