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

Side by Side Diff: sky/engine/core/animation/AnimationPlayer.h

Issue 772673002: Fix Animations, Remove Compostior Animations. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cleanup Created 6 years 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 double startTimeInternal() const { return m_startTime; } 109 double startTimeInternal() const { return m_startTime; }
110 void setStartTime(double); 110 void setStartTime(double);
111 void setStartTimeInternal(double); 111 void setStartTimeInternal(double);
112 112
113 const AnimationNode* source() const { return m_content.get(); } 113 const AnimationNode* source() const { return m_content.get(); }
114 AnimationNode* source() { return m_content.get(); } 114 AnimationNode* source() { return m_content.get(); }
115 void setSource(AnimationNode*); 115 void setSource(AnimationNode*);
116 116
117 // Pausing via this method is not reflected in the value returned by 117 // Pausing via this method is not reflected in the value returned by
118 // paused() and must never overlap with pausing via pause(). 118 // paused() and must never overlap with pausing via pause().
119 void pauseForTesting(double pauseTime); 119 // void pauseForTesting(double pauseTime);
120 // This should only be used for CSS 120 // This should only be used for CSS
121 void unpause(); 121 void unpause();
122 122
123 void setOutdated(); 123 void setOutdated();
124 bool outdated() { return m_outdated; } 124 bool outdated() { return m_outdated; }
125 125
126 bool canStartAnimationOnCompositor();
127 bool maybeStartAnimationOnCompositor();
128 void cancelAnimationOnCompositor();
129 bool hasActiveAnimationsOnCompositor();
130 void setCompositorPending(bool sourceChanged = false); 126 void setCompositorPending(bool sourceChanged = false);
131 void notifyCompositorStartTime(double timelineTime); 127 void notifyCompositorStartTime(double timelineTime);
132 128
133 129
134 void preCommit(bool startOnCompositor); 130 void preCommit(bool startOnCompositor);
135 void postCommit(double timelineTime); 131 void postCommit(double timelineTime);
136 132
137 unsigned sequenceNumber() const { return m_sequenceNumber; } 133 unsigned sequenceNumber() const { return m_sequenceNumber; }
138 134
139 static bool hasLowerPriority(AnimationPlayer* player1, AnimationPlayer* play er2) 135 static bool hasLowerPriority(AnimationPlayer* player1, AnimationPlayer* play er2)
(...skipping 30 matching lines...) Expand all
170 // This indicates timing information relevant to the player's effect 166 // This indicates timing information relevant to the player's effect
171 // has changed by means other than the ordinary progression of time 167 // has changed by means other than the ordinary progression of time
172 bool m_outdated; 168 bool m_outdated;
173 169
174 bool m_finished; 170 bool m_finished;
175 // Holds a 'finished' event queued for asynchronous dispatch via the 171 // Holds a 'finished' event queued for asynchronous dispatch via the
176 // ScriptedAnimationController. This object remains active until the 172 // ScriptedAnimationController. This object remains active until the
177 // event is actually dispatched. 173 // event is actually dispatched.
178 RefPtr<Event> m_pendingFinishedEvent; 174 RefPtr<Event> m_pendingFinishedEvent;
179 175
180 enum CompositorAction { 176 // FIXME(rafaelw): Do we still need this?
181 None,
182 Pause,
183 Start,
184 PauseThenStart
185 };
186
187 class CompositorState {
188 public:
189 CompositorState(AnimationPlayer& player)
190 : startTime(player.m_startTime)
191 , holdTime(player.m_holdTime)
192 , playbackRate(player.m_playbackRate)
193 , sourceChanged(false)
194 , pendingAction(Start)
195 { }
196 double startTime;
197 double holdTime;
198 double playbackRate;
199 bool sourceChanged;
200 CompositorAction pendingAction;
201 };
202
203 // This mirrors the known compositor state. It is created when a compositor
204 // animation is started. Updated once the start time is known and each time
205 // modifications are pushed to the compositor.
206 OwnPtr<CompositorState> m_compositorState;
207 bool m_compositorPending; 177 bool m_compositorPending;
208 bool m_currentTimePending; 178 bool m_currentTimePending;
209 }; 179 };
210 180
211 } // namespace blink 181 } // namespace blink
212 182
213 #endif // SKY_ENGINE_CORE_ANIMATION_ANIMATIONPLAYER_H_ 183 #endif // SKY_ENGINE_CORE_ANIMATION_ANIMATIONPLAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698