Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: Source/core/animation/AnimationClock.h

Issue 369793003: Make the web-animations engine use the passed in blink::WebFrameTime values. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch to run on try bots. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef AnimationClock_h 31 #ifndef AnimationClock_h
32 #define AnimationClock_h 32 #define AnimationClock_h
33 33
34 #include "wtf/CurrentTime.h" 34 #include "public/platform/WebFrameTime.h"
35 #include "wtf/Noncopyable.h" 35 #include "wtf/Noncopyable.h"
36 #include "wtf/PassOwnPtr.h" 36 #include "wtf/PassOwnPtr.h"
37 #include <limits> 37 #include <limits>
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 class AnimationClock { 41 class AnimationClock {
42 WTF_MAKE_NONCOPYABLE(AnimationClock); 42 WTF_MAKE_NONCOPYABLE(AnimationClock);
43 public: 43 public:
44 explicit AnimationClock(WTF::TimeFunction monotonicallyIncreasingTime = WTF: :monotonicallyIncreasingTime) 44 explicit AnimationClock()
45 : m_monotonicallyIncreasingTime(monotonicallyIncreasingTime) 45 : m_frameTime(-1, -1, -1, -1)
eseidel 2014/07/07 16:31:50 Can this be a default constructor on WebFrameTime
mithro-old 2014/07/07 17:47:15 Open to better suggestions on how to deal with the
46 , m_time(0)
47 , m_currentTask(std::numeric_limits<unsigned>::max()) 46 , m_currentTask(std::numeric_limits<unsigned>::max())
48 { 47 {
49 } 48 }
50 49
51 void updateTime(double time); 50 void updateTime(blink::WebFrameTime);
52 double currentTime(); 51 double currentTime();
53 void resetTimeForTesting();
54
55 static void notifyTaskStart() { ++s_currentTask; } 52 static void notifyTaskStart() { ++s_currentTask; }
56 53
54 void resetTimeForTesting();
55 void tickTimeForTesting();
56 void clearTimeForTesting();
57
57 private: 58 private:
58 WTF::TimeFunction m_monotonicallyIncreasingTime; 59 double internalCurrentTime();
59 double m_time; 60
61 blink::WebFrameTime m_frameTime;
60 unsigned m_currentTask; 62 unsigned m_currentTask;
61 static unsigned s_currentTask; 63 static unsigned s_currentTask;
62 }; 64 };
63 65
64 } // namespace WebCore 66 } // namespace WebCore
65 67
66 #endif // AnimationClock_h 68 #endif // AnimationClock_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/AnimationClock.cpp » ('j') | Source/core/animation/AnimationClock.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698