Chromium Code Reviews| Index: third_party/WebKit/Source/core/animation/AnimationClock.h |
| diff --git a/third_party/WebKit/Source/core/animation/AnimationClock.h b/third_party/WebKit/Source/core/animation/AnimationClock.h |
| index c5d38f048cfd7084bef561334f91939821423db9..f668463a219c9c19ff363fd1dc7a3dfcc4ba3107 100644 |
| --- a/third_party/WebKit/Source/core/animation/AnimationClock.h |
| +++ b/third_party/WebKit/Source/core/animation/AnimationClock.h |
| @@ -35,10 +35,14 @@ |
| #include "wtf/Allocator.h" |
| #include "wtf/CurrentTime.h" |
| #include "wtf/Noncopyable.h" |
| + |
| #include <limits> |
| namespace blink { |
| +// Maintains a stationary clock time during script execution. Tries to track |
| +// the glass time (the moment photons leave the screen) of the current animation |
| +// frame. |
|
alancutter (OOO until 2018)
2016/12/13 00:19:01
Optional:
The "Maintains a stationary clock time d
Łukasz Anforowicz
2016/12/13 00:34:03
Thanks for the link. I think I'll leave the comme
|
| class CORE_EXPORT AnimationClock { |
| DISALLOW_NEW(); |
| WTF_MAKE_NONCOPYABLE(AnimationClock); |
| @@ -48,19 +52,21 @@ class CORE_EXPORT AnimationClock { |
| WTF::monotonicallyIncreasingTime) |
| : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime), |
| m_time(0), |
| - m_currentTask(std::numeric_limits<unsigned>::max()) {} |
| + m_taskForWhichTimeWasCalculated(std::numeric_limits<unsigned>::max()) {} |
| void updateTime(double time); |
| double currentTime(); |
| void resetTimeForTesting(double time = 0); |
| - static void notifyTaskStart() { ++s_currentTask; } |
| + // notifyTaskStart should be called right before the main message loop starts |
| + // to run the next task from the message queue. |
| + static void notifyTaskStart() { ++s_currentlyRunningTask; } |
| private: |
| WTF::TimeFunction m_monotonicallyIncreasingTime; |
| double m_time; |
| - unsigned m_currentTask; |
| - static unsigned s_currentTask; |
| + unsigned m_taskForWhichTimeWasCalculated; |
| + static unsigned s_currentlyRunningTask; |
| }; |
| } // namespace blink |