Index: Source/core/animation/AnimationClock.h |
diff --git a/Source/core/animation/AnimationClock.h b/Source/core/animation/AnimationClock.h |
index 540dfbeb2ebd126188b648a079d5a337dfb46ee1..b5bb0d9adc6b5e13f1351019755fac8e21661591 100644 |
--- a/Source/core/animation/AnimationClock.h |
+++ b/Source/core/animation/AnimationClock.h |
@@ -32,39 +32,33 @@ |
#define AnimationClock_h |
#include "wtf/CurrentTime.h" |
+#include "wtf/Noncopyable.h" |
#include "wtf/PassOwnPtr.h" |
+#include <limits> |
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; |
- |
class AnimationClock { |
+ WTF_MAKE_NONCOPYABLE(AnimationClock); |
public: |
- static PassOwnPtr<AnimationClock> create(WTF::TimeFunction monotonicallyIncreasingTime = WTF::monotonicallyIncreasingTime) |
+ explicit AnimationClock(WTF::TimeFunction monotonicallyIncreasingTime = WTF::monotonicallyIncreasingTime) |
+ : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime) |
+ , m_time(0) |
+ , m_currentTask(std::numeric_limits<unsigned>::max()) |
{ |
- return adoptPtr(new AnimationClock(monotonicallyIncreasingTime)); |
} |
void updateTime(double time); |
double currentTime(); |
- void unfreeze() { m_frozen = false; } |
- void resetTimeForTesting() { m_time = 0; m_frozen = true; } |
+ void resetTimeForTesting(); |
+ |
+ static void notifyTaskStart() { ++s_currentTask; } |
private: |
- AnimationClock(WTF::TimeFunction monotonicallyIncreasingTime) |
- : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime) |
- , m_time(0) |
- , m_frozen(false) |
- { |
- } |
WTF::TimeFunction m_monotonicallyIncreasingTime; |
double m_time; |
- bool m_frozen; |
+ unsigned m_currentTask; |
+ static unsigned s_currentTask; |
}; |
} // namespace WebCore |