Allow to control animations frame rate from a custom QAnimationDriver
Don't use time from the global timer (QUnifiedTimer::time.elapsed()) for animations updating when an user overrides QAnimationDriver::elapsed() Task-number: QTBUG-38390 Change-Id: Ic1470b43d8bbc0ee0a2bbb87f7173f97ba03f852 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>bb10
parent
9f6a0300a5
commit
4833e5080c
|
|
@ -253,8 +253,9 @@ QUnifiedTimer *QUnifiedTimer::instance()
|
|||
|
||||
void QUnifiedTimer::maybeUpdateAnimationsToCurrentTime()
|
||||
{
|
||||
if (time.elapsed() - lastTick > 50)
|
||||
updateAnimationTimers(driver->elapsed());
|
||||
qint64 elapsed = driver->elapsed();
|
||||
if (elapsed - lastTick > 50)
|
||||
updateAnimationTimers(elapsed);
|
||||
}
|
||||
|
||||
void QUnifiedTimer::updateAnimationTimers(qint64 currentTick)
|
||||
|
|
@ -263,7 +264,7 @@ void QUnifiedTimer::updateAnimationTimers(qint64 currentTick)
|
|||
if(insideTick)
|
||||
return;
|
||||
|
||||
qint64 totalElapsed = currentTick >= 0 ? currentTick : time.elapsed();
|
||||
qint64 totalElapsed = currentTick >= 0 ? currentTick : driver->elapsed();
|
||||
|
||||
// ignore consistentTiming in case the pause timer is active
|
||||
qint64 delta = (consistentTiming && !pauseTimer.isActive()) ?
|
||||
|
|
|
|||
Loading…
Reference in New Issue