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

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

Issue 2791513002: Reset is_ticking_ when calling AnimationPlayer::RemoveFromTicking (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/animation_player.h" 5 #include "cc/animation/animation_player.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "cc/animation/animation_delegate.h" 10 #include "cc/animation/animation_delegate.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } else if (!is_ticking_ && (was_ticking || force)) { 324 } else if (!is_ticking_ && (was_ticking || force)) {
325 RemoveFromTicking(); 325 RemoveFromTicking();
326 } 326 }
327 } 327 }
328 } 328 }
329 329
330 void AnimationPlayer::RemoveFromTicking() { 330 void AnimationPlayer::RemoveFromTicking() {
331 DCHECK(animation_host_); 331 DCHECK(animation_host_);
332 // Resetting last_tick_time_ here ensures that calling ::UpdateState 332 // Resetting last_tick_time_ here ensures that calling ::UpdateState
333 // before ::Animate doesn't start an animation. 333 // before ::Animate doesn't start an animation.
334 is_ticking_ = false;
334 last_tick_time_ = base::TimeTicks(); 335 last_tick_time_ = base::TimeTicks();
335 animation_host_->RemoveFromTicking(this); 336 animation_host_->RemoveFromTicking(this);
336 } 337 }
337 338
338 bool AnimationPlayer::NotifyAnimationStarted(const AnimationEvent& event) { 339 bool AnimationPlayer::NotifyAnimationStarted(const AnimationEvent& event) {
339 DCHECK(!event.is_impl_only); 340 DCHECK(!event.is_impl_only);
340 341
341 for (size_t i = 0; i < animations_.size(); ++i) { 342 for (size_t i = 0; i < animations_.size(); ++i) {
342 if (animations_[i]->group() == event.group_id && 343 if (animations_[i]->group() == event.group_id &&
343 animations_[i]->target_property() == event.target_property && 344 animations_[i]->target_property() == event.target_property &&
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 if (current_impl) 1189 if (current_impl)
1189 animations_[i]->PushPropertiesTo(current_impl); 1190 animations_[i]->PushPropertiesTo(current_impl);
1190 } 1191 }
1191 1192
1192 animation_player_impl->scroll_offset_animation_was_interrupted_ = 1193 animation_player_impl->scroll_offset_animation_was_interrupted_ =
1193 scroll_offset_animation_was_interrupted_; 1194 scroll_offset_animation_was_interrupted_;
1194 scroll_offset_animation_was_interrupted_ = false; 1195 scroll_offset_animation_was_interrupted_ = false;
1195 } 1196 }
1196 1197
1197 } // namespace cc 1198 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698