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

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

Issue 231133002: CC::Animations should use TimeTicks & TimeDelta to represent time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code Refactored as per the comments. Created 6 years, 8 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 // 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_animator.h" 5 #include "ui/compositor/layer_animator.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "cc/animation/animation_id_provider.h" 10 #include "cc/animation/animation_id_provider.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 return; 315 return;
316 DCHECK(running->is_sequence_alive()); 316 DCHECK(running->is_sequence_alive());
317 317
318 if (running->sequence()->animation_group_id() != event.group_id) 318 if (running->sequence()->animation_group_id() != event.group_id)
319 return; 319 return;
320 320
321 running->sequence()->OnThreadedAnimationStarted(event); 321 running->sequence()->OnThreadedAnimationStarted(event);
322 if (!running->sequence()->waiting_for_group_start()) 322 if (!running->sequence()->waiting_for_group_start())
323 return; 323 return;
324 324
325 base::TimeTicks start_time = base::TimeTicks::FromInternalValue( 325 base::TimeTicks start_time = event.monotonic_time;
326 event.monotonic_time * base::Time::kMicrosecondsPerSecond);
327 326
328 running->sequence()->set_waiting_for_group_start(false); 327 running->sequence()->set_waiting_for_group_start(false);
329 328
330 // The call to GetRunningAnimation made above already purged deleted 329 // The call to GetRunningAnimation made above already purged deleted
331 // animations, so we are guaranteed that all the animations we iterate 330 // animations, so we are guaranteed that all the animations we iterate
332 // over now are alive. 331 // over now are alive.
333 for (RunningAnimations::iterator iter = running_animations_.begin(); 332 for (RunningAnimations::iterator iter = running_animations_.begin();
334 iter != running_animations_.end(); ++iter) { 333 iter != running_animations_.end(); ++iter) {
335 // Ensure that each sequence is only Started once, regardless of the 334 // Ensure that each sequence is only Started once, regardless of the
336 // number of sequences in the group that have threaded first elements. 335 // number of sequences in the group that have threaded first elements.
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 } 840 }
842 841
843 LayerAnimator::RunningAnimation::RunningAnimation( 842 LayerAnimator::RunningAnimation::RunningAnimation(
844 const base::WeakPtr<LayerAnimationSequence>& sequence) 843 const base::WeakPtr<LayerAnimationSequence>& sequence)
845 : sequence_(sequence) { 844 : sequence_(sequence) {
846 } 845 }
847 846
848 LayerAnimator::RunningAnimation::~RunningAnimation() { } 847 LayerAnimator::RunningAnimation::~RunningAnimation() { }
849 848
850 } // namespace ui 849 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698