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

Side by Side Diff: ui/compositor/layer_animation_sequence.cc

Issue 12517003: cc: Chromify the Animation and LayerAnimationController classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « ui/compositor/layer_animation_element.cc ('k') | ui/compositor/layer_animator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/compositor/layer_animation_sequence.h" 5 #include "ui/compositor/layer_animation_sequence.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 200 }
201 } 201 }
202 202
203 void LayerAnimationSequence::RemoveObserver(LayerAnimationObserver* observer) { 203 void LayerAnimationSequence::RemoveObserver(LayerAnimationObserver* observer) {
204 observers_.RemoveObserver(observer); 204 observers_.RemoveObserver(observer);
205 observer->DetachedFromSequence(this, true); 205 observer->DetachedFromSequence(this, true);
206 } 206 }
207 207
208 void LayerAnimationSequence::OnThreadedAnimationStarted( 208 void LayerAnimationSequence::OnThreadedAnimationStarted(
209 const cc::AnimationEvent& event) { 209 const cc::AnimationEvent& event) {
210 if (elements_.empty() || event.groupId != animation_group_id_) 210 if (elements_.empty() || event.group_id != animation_group_id_)
211 return; 211 return;
212 212
213 size_t current_index = last_element_ % elements_.size(); 213 size_t current_index = last_element_ % elements_.size();
214 const LayerAnimationElement::AnimatableProperties& element_properties = 214 const LayerAnimationElement::AnimatableProperties& element_properties =
215 elements_[current_index]->properties(); 215 elements_[current_index]->properties();
216 LayerAnimationElement::AnimatableProperty event_property = 216 LayerAnimationElement::AnimatableProperty event_property =
217 LayerAnimationElement::ToAnimatableProperty(event.targetProperty); 217 LayerAnimationElement::ToAnimatableProperty(event.target_property);
218 DCHECK(element_properties.find(event_property) != element_properties.end()); 218 DCHECK(element_properties.find(event_property) != element_properties.end());
219 elements_[current_index]->set_effective_start_time( 219 elements_[current_index]->set_effective_start_time(
220 base::TimeTicks::FromInternalValue( 220 base::TimeTicks::FromInternalValue(
221 event.monotonicTime * base::Time::kMicrosecondsPerSecond)); 221 event.monotonic_time * base::Time::kMicrosecondsPerSecond));
222 } 222 }
223 223
224 void LayerAnimationSequence::OnScheduled() { 224 void LayerAnimationSequence::OnScheduled() {
225 NotifyScheduled(); 225 NotifyScheduled();
226 } 226 }
227 227
228 void LayerAnimationSequence::OnAnimatorDestroyed() { 228 void LayerAnimationSequence::OnAnimatorDestroyed() {
229 if (observers_.might_have_observers()) { 229 if (observers_.might_have_observers()) {
230 ObserverListBase<LayerAnimationObserver>::Iterator it(observers_); 230 ObserverListBase<LayerAnimationObserver>::Iterator it(observers_);
231 LayerAnimationObserver* obs; 231 LayerAnimationObserver* obs;
(...skipping 27 matching lines...) Expand all
259 259
260 LayerAnimationElement* LayerAnimationSequence::CurrentElement() { 260 LayerAnimationElement* LayerAnimationSequence::CurrentElement() {
261 if (elements_.empty()) 261 if (elements_.empty())
262 return NULL; 262 return NULL;
263 263
264 size_t current_index = last_element_ % elements_.size(); 264 size_t current_index = last_element_ % elements_.size();
265 return elements_[current_index].get(); 265 return elements_[current_index].get();
266 } 266 }
267 267
268 } // namespace ui 268 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer_animation_element.cc ('k') | ui/compositor/layer_animator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698