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

Side by Side Diff: cc/animation/layer_animation_controller.cc

Issue 23926003: Take time_offset into account when ticking animations that are Starting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « cc/animation/animation_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/animation/layer_animation_controller.h" 5 #include "cc/animation/layer_animation_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/animation/animation.h" 9 #include "cc/animation/animation.h"
10 #include "cc/animation/animation_delegate.h" 10 #include "cc/animation/animation_delegate.h"
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 } 664 }
665 665
666 void LayerAnimationController::TickAnimations(double monotonic_time) { 666 void LayerAnimationController::TickAnimations(double monotonic_time) {
667 for (size_t i = 0; i < active_animations_.size(); ++i) { 667 for (size_t i = 0; i < active_animations_.size(); ++i) {
668 if (active_animations_[i]->run_state() == Animation::Starting || 668 if (active_animations_[i]->run_state() == Animation::Starting ||
669 active_animations_[i]->run_state() == Animation::Running || 669 active_animations_[i]->run_state() == Animation::Running ||
670 active_animations_[i]->run_state() == Animation::Paused) { 670 active_animations_[i]->run_state() == Animation::Paused) {
671 double trimmed = 671 double trimmed =
672 active_animations_[i]->TrimTimeToCurrentIteration(monotonic_time); 672 active_animations_[i]->TrimTimeToCurrentIteration(monotonic_time);
673 673
674 // Animation assumes its initial value until it gets the synchronized
675 // start time from the impl thread and can start ticking.
676 if (active_animations_[i]->needs_synchronized_start_time())
677 trimmed = 0;
678
679 // A just-started animation assumes its initial value.
680 if (active_animations_[i]->run_state() == Animation::Starting &&
681 !active_animations_[i]->has_set_start_time())
682 trimmed = 0;
683
684 switch (active_animations_[i]->target_property()) { 674 switch (active_animations_[i]->target_property()) {
685 case Animation::Transform: { 675 case Animation::Transform: {
686 const TransformAnimationCurve* transform_animation_curve = 676 const TransformAnimationCurve* transform_animation_curve =
687 active_animations_[i]->curve()->ToTransformAnimationCurve(); 677 active_animations_[i]->curve()->ToTransformAnimationCurve();
688 const gfx::Transform transform = 678 const gfx::Transform transform =
689 transform_animation_curve->GetValue(trimmed); 679 transform_animation_curve->GetValue(trimmed);
690 NotifyObserversTransformAnimated(transform); 680 NotifyObserversTransformAnimated(transform);
691 break; 681 break;
692 } 682 }
693 683
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 value_observers_); 736 value_observers_);
747 LayerAnimationValueObserver* obs; 737 LayerAnimationValueObserver* obs;
748 while ((obs = it.GetNext()) != NULL) 738 while ((obs = it.GetNext()) != NULL)
749 if (obs->IsActive()) 739 if (obs->IsActive())
750 return true; 740 return true;
751 } 741 }
752 return false; 742 return false;
753 } 743 }
754 744
755 } // namespace cc 745 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/animation_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698