diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2012-05-24 16:05:17 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-29 10:54:05 +0200 |
commit | 4baa3f7105004ce815b5b16b05d895814263e987 (patch) | |
tree | fa60f50feb8424f66cd443bee86c99416cb6fdbd /src/quick/items/qquickwindowmanager.cpp | |
parent | 3c7ac8bd3af7e11edb0af6767f8953b7c812352c (diff) |
Enable QML_FIXED_ANIMATION_STEP by default with buffer queueing.
On Mac OS X and other systems with buffer queueing GL,
we have very jerky animations as the pipeline
does not block at regular intervals, causing the
current-time based animations to come out very jerky
despite us rendering at 60 FPS with a very good margin.
To remedy this, we switch the default so that we by default
advance with a fixed increment, making the uneven frames
not a problem. This then comes at the cost of that animations
will slow down if the application does not manage to render
within 16 ms, but this is an acceptible compromise. Aka,
now it will occationally look bad, as opposed to always bad
which it currently does.
Change-Id: I44a6c3e51f434e4235e49485182380ea531876d9
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/quick/items/qquickwindowmanager.cpp')
-rw-r--r-- | src/quick/items/qquickwindowmanager.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/quick/items/qquickwindowmanager.cpp b/src/quick/items/qquickwindowmanager.cpp index 392085a40c..2022d24622 100644 --- a/src/quick/items/qquickwindowmanager.cpp +++ b/src/quick/items/qquickwindowmanager.cpp @@ -135,7 +135,6 @@ extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_ after shouldExit has been set to true. */ -DEFINE_BOOL_CONFIG_OPTION(qmlFixedAnimationStep, QML_FIXED_ANIMATION_STEP); DEFINE_BOOL_CONFIG_OPTION(qmlNoThreadedRenderer, QML_BAD_GUI_RENDER_LOOP); DEFINE_BOOL_CONFIG_OPTION(qmlForceThreadedRenderer, QML_FORCE_THREADED_RENDERER); // Might trigger graphics driver threading bugs, use at own risk @@ -332,14 +331,22 @@ QQuickWindowManager *QQuickWindowManager::instance() theInstance = QSGContext::createWindowManager(); - bool fancy = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::BufferQueueingOpenGL) + bool bufferQueuing = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::BufferQueueingOpenGL); + bool fancy = bufferQueuing && QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL); if (qmlNoThreadedRenderer()) fancy = false; else if (qmlForceThreadedRenderer()) fancy = true; - if (qmlFixedAnimationStep()) + // Enable fixed animation steps... + QByteArray fixed = qgetenv("QML_FIXED_ANIMATION_STEP"); + bool fixedAnimationSteps = bufferQueuing; + if (fixed == "no") + fixedAnimationSteps = false; + else if (fixed.length()) + fixedAnimationSteps = true; + if (fixedAnimationSteps) QUnifiedTimer::instance(true)->setConsistentTiming(true); if (!theInstance) { |