From 30a4d9bc99caae9e7254da18c95b5422e6917688 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 12 Dec 2011 14:40:35 +1000 Subject: Only call profiler callback once per animation tick. Change-Id: I369afdf34ded2c6327ce36cdb80fab51bf89a1b5 Reviewed-by: Christiaan Janssen --- src/corelib/animation/qabstractanimation.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 1d0715e6d9..11113138a7 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -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; -- cgit v1.2.3