Chromium Code Reviews| Index: Source/core/animation/AnimationClock.h |
| diff --git a/Source/core/animation/AnimationClock.h b/Source/core/animation/AnimationClock.h |
| index f6a2cdb84991f6777818a1f67bf251d269e1b757..3b295d770235f57cd6de2170159552d0ba919e78 100644 |
| --- a/Source/core/animation/AnimationClock.h |
| +++ b/Source/core/animation/AnimationClock.h |
| @@ -36,6 +36,13 @@ |
| namespace WebCore { |
| +// FIXME: This value is used to suppress updates when time is required outside of a frame. |
| +// The purpose of allowing the clock to update during such periods is to allow animations |
| +// to have an appropriate start time and for getComputedStyle to attempt to catch-up to a |
| +// compositor animation. However a more accurate system might be to attempt to phase-lock |
| +// with the frame clock. |
| +const double minTimeBeforeUnsynchronizedAnimationClockTick = 0.005; |
|
abarth-chromium
2014/02/24 06:14:08
Where does this constant come from? Would this co
dstockwell
2014/02/24 06:58:07
I think whatever we choose here is going to be fai
|
| + |
| class AnimationClock { |
| public: |
| static PassOwnPtr<AnimationClock> create(WTF::TimeFunction monotonicallyIncreasingTime = WTF::monotonicallyIncreasingTime) |
| @@ -52,8 +59,11 @@ public: |
| double currentTime() |
|
abarth-chromium
2014/02/24 06:14:08
Should we move these functions out of line now tha
dstockwell
2014/02/24 12:41:16
Done.
|
| { |
| - if (!m_frozen) |
| - updateTime(m_monotonicallyIncreasingTime()); |
| + if (!m_frozen) { |
| + double newTime = m_monotonicallyIncreasingTime(); |
| + if (newTime >= m_time + minTimeBeforeUnsynchronizedAnimationClockTick) |
| + m_time = newTime; |
| + } |
| return m_time; |
| } |