| Index: Source/core/animation/AnimationClock.cpp
|
| diff --git a/Source/core/animation/AnimationClock.cpp b/Source/core/animation/AnimationClock.cpp
|
| index 6afcc6f8e089954cf5e96a6842312ae8e7c289fc..649220690e67a27adf18592ac5d9a46d000c9ff2 100644
|
| --- a/Source/core/animation/AnimationClock.cpp
|
| +++ b/Source/core/animation/AnimationClock.cpp
|
| @@ -28,54 +28,26 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#include <math.h>
|
| #include "config.h"
|
| #include "core/animation/AnimationClock.h"
|
| -#include "wtf/CurrentTime.h"
|
| -
|
| -namespace {
|
| -
|
| -// FIXME: This is an approximation of time between frames, used when
|
| -// ticking the animation clock outside of animation frame callbacks.
|
| -// Ideally this would be generated by the compositor.
|
| -const double approximateFrameTime = 1 / 60.0;
|
| -
|
| -}
|
|
|
| namespace WebCore {
|
|
|
| -unsigned AnimationClock::s_currentTask = 0;
|
| -
|
| void AnimationClock::updateTime(double time)
|
| {
|
| if (time > m_time)
|
| m_time = time;
|
| - m_currentTask = s_currentTask;
|
| + m_frozen = true;
|
| }
|
|
|
| double AnimationClock::currentTime()
|
| {
|
| - if (m_currentTask != s_currentTask) {
|
| - double currentTime = m_monotonicallyIncreasingTime();
|
| - if (m_time < currentTime) {
|
| - // Advance to the first estimated frame at or after the current time.
|
| - unsigned advanceCount = ceil((currentTime - m_time) / approximateFrameTime);
|
| - double newTime = m_time + advanceCount * approximateFrameTime;
|
| - ASSERT(newTime >= currentTime);
|
| - ASSERT(newTime <= currentTime + approximateFrameTime);
|
| - updateTime(newTime);
|
| - } else {
|
| - m_currentTask = s_currentTask;
|
| - }
|
| + if (!m_frozen) {
|
| + double newTime = m_monotonicallyIncreasingTime();
|
| + if (newTime >= m_time + minTimeBeforeUnsynchronizedAnimationClockTick)
|
| + m_time = newTime;
|
| }
|
| return m_time;
|
| }
|
|
|
| -void AnimationClock::resetTimeForTesting()
|
| -{
|
| - m_time = 0;
|
| - m_currentTask = 0;
|
| - s_currentTask = 0;
|
| -}
|
| -
|
| }
|
|
|