diff options
author | Aram So <aram.so@lge.com> | 2016-03-03 10:55:23 +0900 |
---|---|---|
committer | Aram So <aram.so@lge.com> | 2016-03-07 14:48:20 +0000 |
commit | 3879b3f883dd66feddc190eb8bad330367a31ace (patch) | |
tree | f4052e2175923f46c851eedaaf8d350f8064533d /src/quick/scenegraph | |
parent | 2f85907193ad934d911fe97f7000ecb0662de8cb (diff) |
Allow fixed animation step in QSGGuiThreadRenderLoop
This patch allows to enable the fixed animation step in
QSGGuiThreadRenderLoop if QSG_FIXED_ANIMATION_STEP is set.
Change-Id: I87ff26120283d93e9b8d08286a16990cf6d649ce
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Aram So <aram.so@lge.com>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 6572ceb2ce..2ba16e7328 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -136,9 +136,9 @@ public: bool distanceFieldAntialiasingDecided; }; -static bool qsg_useConsistentTiming() +bool qsg_useConsistentTiming() { - static int use = -1; + int use = -1; if (use < 0) { use = !qEnvironmentVariableIsEmpty("QSG_FIXED_ANIMATION_STEP") && qgetenv("QSG_FIXED_ANIMATION_STEP") != "no" ? 1 : 0; diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index b5f149eff7..cd0f77799b 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE - +extern bool qsg_useConsistentTiming(); extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha); /*! @@ -267,6 +267,10 @@ void QSGRenderLoop::handleContextCreationFailure(QQuickWindow *window, QSGGuiThreadRenderLoop::QSGGuiThreadRenderLoop() : gl(0) { + if (qsg_useConsistentTiming()) { + QUnifiedTimer::instance(true)->setConsistentTiming(true); + qCDebug(QSG_LOG_INFO, "using fixed animation steps"); + } sg = QSGContext::createDefaultContext(); rc = sg->createRenderContext(); } |