Only call profiler callback once per animation tick.

Change-Id: I369afdf34ded2c6327ce36cdb80fab51bf89a1b5
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
bb10
Michael Brasser 2011-12-12 14:40:35 +10:00 committed by Qt by Nokia
parent 08d378d933
commit 30a4d9bc99
1 changed files with 2 additions and 3 deletions

View File

@ -230,14 +230,13 @@ void QUnifiedTimer::updateAnimationsTime(qint64 timeStep)
//when the CPU load is high
if (delta) {
insideTick = true;
if (profilerCallback)
profilerCallback(delta);
for (currentAnimationIdx = 0; currentAnimationIdx < animations.count(); ++currentAnimationIdx) {
QAbstractAnimation *animation = animations.at(currentAnimationIdx);
int elapsed = QAbstractAnimationPrivate::get(animation)->totalCurrentTime
+ (animation->direction() == QAbstractAnimation::Forward ? delta : -delta);
animation->setCurrentTime(elapsed);
if (profilerCallback)
profilerCallback(delta);
}
insideTick = false;
currentAnimationIdx = 0;