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

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

Issue 361143002: Impl thread smooth scrolling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 5 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
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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 if (!animations_[i]->has_set_start_time() && 680 if (!animations_[i]->has_set_start_time() &&
681 !animations_[i]->needs_synchronized_start_time()) 681 !animations_[i]->needs_synchronized_start_time())
682 animations_[i]->set_start_time(monotonic_time); 682 animations_[i]->set_start_time(monotonic_time);
683 if (events) { 683 if (events) {
684 AnimationEvent started_event(AnimationEvent::Started, 684 AnimationEvent started_event(AnimationEvent::Started,
685 id_, 685 id_,
686 animations_[i]->group(), 686 animations_[i]->group(),
687 animations_[i]->target_property(), 687 animations_[i]->target_property(),
688 monotonic_time); 688 monotonic_time);
689 started_event.is_impl_only = animations_[i]->is_impl_only(); 689 started_event.is_impl_only = animations_[i]->is_impl_only();
690 events->push_back(started_event); 690 if (started_event.is_impl_only)
691 NotifyAnimationStarted(started_event);
692 else
693 events->push_back(started_event);
691 } 694 }
692 } 695 }
693 } 696 }
694 } 697 }
695 698
696 void LayerAnimationController::MarkFinishedAnimations( 699 void LayerAnimationController::MarkFinishedAnimations(
697 base::TimeTicks monotonic_time) { 700 base::TimeTicks monotonic_time) {
698 for (size_t i = 0; i < animations_.size(); ++i) { 701 for (size_t i = 0; i < animations_.size(); ++i) {
699 if (animations_[i]->IsFinishedAt(monotonic_time) && 702 if (animations_[i]->IsFinishedAt(monotonic_time) &&
700 animations_[i]->run_state() != Animation::Aborted && 703 animations_[i]->run_state() != Animation::Aborted &&
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 for (size_t j = i; j < animations_.size(); j++) { 763 for (size_t j = i; j < animations_.size(); j++) {
761 if (animations_[j]->group() == group_id && 764 if (animations_[j]->group() == group_id &&
762 animations_[j]->run_state() != Animation::Aborted) { 765 animations_[j]->run_state() != Animation::Aborted) {
763 if (events) { 766 if (events) {
764 AnimationEvent finished_event(AnimationEvent::Finished, 767 AnimationEvent finished_event(AnimationEvent::Finished,
765 id_, 768 id_,
766 animations_[j]->group(), 769 animations_[j]->group(),
767 animations_[j]->target_property(), 770 animations_[j]->target_property(),
768 monotonic_time); 771 monotonic_time);
769 finished_event.is_impl_only = animations_[j]->is_impl_only(); 772 finished_event.is_impl_only = animations_[j]->is_impl_only();
770 events->push_back(finished_event); 773 if (finished_event.is_impl_only)
774 NotifyAnimationFinished(finished_event);
775 else
776 events->push_back(finished_event);
771 } 777 }
772 animations_[j]->SetRunState(Animation::WaitingForDeletion, 778 animations_[j]->SetRunState(Animation::WaitingForDeletion,
773 monotonic_time); 779 monotonic_time);
774 } 780 }
775 } 781 }
776 marked_animations_for_deletions = true; 782 marked_animations_for_deletions = true;
777 } 783 }
778 } 784 }
779 if (marked_animations_for_deletions) 785 if (marked_animations_for_deletions)
780 NotifyObserversAnimationWaitingForDeletion(); 786 NotifyObserversAnimationWaitingForDeletion();
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 value_observers_); 971 value_observers_);
966 LayerAnimationValueObserver* obs; 972 LayerAnimationValueObserver* obs;
967 while ((obs = it.GetNext()) != NULL) 973 while ((obs = it.GetNext()) != NULL)
968 if (obs->IsActive()) 974 if (obs->IsActive())
969 return true; 975 return true;
970 } 976 }
971 return false; 977 return false;
972 } 978 }
973 979
974 } // namespace cc 980 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/layer_animation_controller.h ('k') | cc/animation/layer_animation_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698