| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 public: | 43 public: |
| 44 explicit AnimationClock(WTF::TimeFunction monotonicallyIncreasingTime = WTF:
:monotonicallyIncreasingTime) | 44 explicit AnimationClock(WTF::TimeFunction monotonicallyIncreasingTime = WTF:
:monotonicallyIncreasingTime) |
| 45 : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime) | 45 : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime) |
| 46 , m_time(0) | 46 , m_time(0) |
| 47 , m_currentTask(std::numeric_limits<unsigned>::max()) | 47 , m_currentTask(std::numeric_limits<unsigned>::max()) |
| 48 { | 48 { |
| 49 } | 49 } |
| 50 | 50 |
| 51 void updateTime(double time); | 51 void updateTime(double time); |
| 52 double currentTime(); | 52 double currentTime(); |
| 53 void resetTimeForTesting(); | 53 void resetTimeForTesting(double time = 0); |
| 54 | 54 |
| 55 static void notifyTaskStart() { ++s_currentTask; } | 55 static void notifyTaskStart() { ++s_currentTask; } |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 WTF::TimeFunction m_monotonicallyIncreasingTime; | 58 WTF::TimeFunction m_monotonicallyIncreasingTime; |
| 59 double m_time; | 59 double m_time; |
| 60 unsigned m_currentTask; | 60 unsigned m_currentTask; |
| 61 static unsigned s_currentTask; | 61 static unsigned s_currentTask; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace blink | 64 } // namespace blink |
| 65 | 65 |
| 66 #endif // AnimationClock_h | 66 #endif // AnimationClock_h |
| OLD | NEW |