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

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

Issue 881183003: Animation: Cancel same-property animations on compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add manual test. Improve code a bit. Created 5 years, 10 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
« no previous file with comments | « Source/core/animation/AnimationEffect.h ('k') | Source/core/animation/AnimationPlayer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 15 matching lines...) Expand all
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 AnimationPlayer_h 31 #ifndef AnimationPlayer_h
32 #define AnimationPlayer_h 32 #define AnimationPlayer_h
33 33
34 #include "bindings/core/v8/ScriptPromise.h" 34 #include "bindings/core/v8/ScriptPromise.h"
35 #include "bindings/core/v8/ScriptPromiseProperty.h" 35 #include "bindings/core/v8/ScriptPromiseProperty.h"
36 #include "core/CSSPropertyNames.h"
36 #include "core/animation/AnimationNode.h" 37 #include "core/animation/AnimationNode.h"
37 #include "core/dom/ActiveDOMObject.h" 38 #include "core/dom/ActiveDOMObject.h"
38 #include "core/dom/DOMException.h" 39 #include "core/dom/DOMException.h"
39 #include "core/events/EventTarget.h" 40 #include "core/events/EventTarget.h"
40 #include "platform/heap/Handle.h" 41 #include "platform/heap/Handle.h"
41 #include "wtf/RefPtr.h" 42 #include "wtf/RefPtr.h"
42 43
43 namespace blink { 44 namespace blink {
44 45
45 class AnimationTimeline; 46 class AnimationTimeline;
47 class Element;
46 class ExceptionState; 48 class ExceptionState;
47 49
48 class AnimationPlayer final 50 class AnimationPlayer final
49 : public EventTargetWithInlineData 51 : public EventTargetWithInlineData
50 , public RefCountedWillBeNoBase<AnimationPlayer> 52 , public RefCountedWillBeNoBase<AnimationPlayer>
51 , public ActiveDOMObject { 53 , public ActiveDOMObject {
52 DEFINE_WRAPPERTYPEINFO(); 54 DEFINE_WRAPPERTYPEINFO();
53 REFCOUNTED_EVENT_TARGET(AnimationPlayer); 55 REFCOUNTED_EVENT_TARGET(AnimationPlayer);
54 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AnimationPlayer); 56 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AnimationPlayer);
55 public: 57 public:
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 void pauseForTesting(double pauseTime); 135 void pauseForTesting(double pauseTime);
134 // This should only be used for CSS 136 // This should only be used for CSS
135 void unpause(); 137 void unpause();
136 138
137 void setOutdated(); 139 void setOutdated();
138 bool outdated() { return m_outdated; } 140 bool outdated() { return m_outdated; }
139 141
140 bool canStartAnimationOnCompositor(); 142 bool canStartAnimationOnCompositor();
141 bool maybeStartAnimationOnCompositor(); 143 bool maybeStartAnimationOnCompositor();
142 void cancelAnimationOnCompositor(); 144 void cancelAnimationOnCompositor();
145 void cancelIncompatibleAnimationsOnCompositor();
143 bool hasActiveAnimationsOnCompositor(); 146 bool hasActiveAnimationsOnCompositor();
144 void setCompositorPending(bool sourceChanged = false); 147 void setCompositorPending(bool sourceChanged = false);
145 void notifyCompositorStartTime(double timelineTime); 148 void notifyCompositorStartTime(double timelineTime);
146 void notifyStartTime(double timelineTime); 149 void notifyStartTime(double timelineTime);
147 150
151 bool affects(const Element&, CSSPropertyID) const;
148 152
149 void preCommit(int compositorGroup, bool startOnCompositor); 153 void preCommit(int compositorGroup, bool startOnCompositor);
150 void postCommit(double timelineTime); 154 void postCommit(double timelineTime);
151 155
152 unsigned sequenceNumber() const { return m_sequenceNumber; } 156 unsigned sequenceNumber() const { return m_sequenceNumber; }
153 int compositorGroup() const { return m_compositorGroup; } 157 int compositorGroup() const { return m_compositorGroup; }
154 158
155 static bool hasLowerPriority(AnimationPlayer* player1, AnimationPlayer* play er2) 159 static bool hasLowerPriority(const AnimationPlayer* player1, const Animation Player* player2)
156 { 160 {
157 return player1->sequenceNumber() < player2->sequenceNumber(); 161 return player1->sequenceNumber() < player2->sequenceNumber();
158 } 162 }
159 163
160 #if !ENABLE(OILPAN) 164 #if !ENABLE(OILPAN)
161 // Checks if the AnimationStack is the last reference holder to the Player. 165 // Checks if the AnimationStack is the last reference holder to the Player.
162 // This won't be needed when AnimationPlayer is moved to Oilpan. 166 // This won't be needed when AnimationPlayer is moved to Oilpan.
163 bool canFree() const; 167 bool canFree() const;
164 #endif 168 #endif
165 169
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 int m_compositorGroup; 263 int m_compositorGroup;
260 264
261 bool m_currentTimePending; 265 bool m_currentTimePending;
262 bool m_stateIsBeingUpdated; 266 bool m_stateIsBeingUpdated;
263 267
264 }; 268 };
265 269
266 } // namespace blink 270 } // namespace blink
267 271
268 #endif // AnimationPlayer_h 272 #endif // AnimationPlayer_h
OLDNEW
« no previous file with comments | « Source/core/animation/AnimationEffect.h ('k') | Source/core/animation/AnimationPlayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698