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

Unified Diff: cc/animation/layer_animation_controller.cc

Issue 864003002: cc: Make LayerAnimationController keep state for clearing scroll delta (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/layer_animation_controller.cc
diff --git a/cc/animation/layer_animation_controller.cc b/cc/animation/layer_animation_controller.cc
index 5f6beed3e052929b0d08d1ebcd43128032e4f538..1892dd4490d9200b6022a50b94fcead1d46893fe 100644
--- a/cc/animation/layer_animation_controller.cc
+++ b/cc/animation/layer_animation_controller.cc
@@ -27,7 +27,8 @@ LayerAnimationController::LayerAnimationController(int id)
is_active_(false),
value_provider_(nullptr),
layer_animation_delegate_(nullptr),
- needs_to_start_animations_(false) {
+ needs_to_start_animations_(false),
+ scroll_offset_animation_was_interrupted_(false) {
}
LayerAnimationController::~LayerAnimationController() {
@@ -65,7 +66,7 @@ void LayerAnimationController::RemoveAnimation(int animation_id) {
animations_.remove_if(HasAnimationId(animation_id));
for (auto it = animations_to_remove; it != animations_.end(); ++it) {
if ((*it)->target_property() == Animation::ScrollOffset) {
- NotifyObserversScrollOffsetAnimationRemoved();
+ scroll_offset_animation_was_interrupted_ = true;
break;
}
}
@@ -93,7 +94,7 @@ void LayerAnimationController::RemoveAnimation(
HasAnimationIdAndProperty(animation_id, target_property));
if (target_property == Animation::ScrollOffset &&
animations_to_remove != animations_.end())
- NotifyObserversScrollOffsetAnimationRemoved();
+ scroll_offset_animation_was_interrupted_ = true;
animations_.erase(animations_to_remove, animations_.end());
UpdateActivation(NormalActivation);
@@ -256,6 +257,7 @@ void LayerAnimationController::ActivateAnimations() {
animations_.end(),
AffectsNoObservers()),
animations_.end());
+ scroll_offset_animation_was_interrupted_ = false;
UpdateActivation(NormalActivation);
}
@@ -628,13 +630,16 @@ void LayerAnimationController::RemoveAnimationsCompletedOnMainThread(
}
void LayerAnimationController::PushPropertiesToImplThread(
- LayerAnimationController* controller_impl) const {
+ LayerAnimationController* controller_impl) {
for (size_t i = 0; i < animations_.size(); ++i) {
Animation* current_impl =
controller_impl->GetAnimationById(animations_[i]->id());
if (current_impl)
animations_[i]->PushPropertiesTo(current_impl);
}
+ controller_impl->scroll_offset_animation_was_interrupted_ =
+ scroll_offset_animation_was_interrupted_;
+ scroll_offset_animation_was_interrupted_ = false;
}
void LayerAnimationController::StartAnimations(base::TimeTicks monotonic_time) {
@@ -1034,11 +1039,6 @@ void LayerAnimationController::NotifyObserversAnimationWaitingForDeletion() {
OnAnimationWaitingForDeletion());
}
-void LayerAnimationController::NotifyObserversScrollOffsetAnimationRemoved() {
- FOR_EACH_OBSERVER(LayerAnimationValueObserver, value_observers_,
- OnScrollOffsetAnimationRemoved());
-}
-
bool LayerAnimationController::HasValueObserver() {
if (value_observers_.might_have_observers()) {
ObserverListBase<LayerAnimationValueObserver>::Iterator it(
« 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