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

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

Issue 2793383002: 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 "cc/animation/animation_delegate.h" 9 #include "cc/animation/animation_delegate.h"
10 #include "cc/animation/animation_events.h" 10 #include "cc/animation/animation_events.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 } else if (!is_ticking_ && (was_ticking || force)) { 323 } else if (!is_ticking_ && (was_ticking || force)) {
324 RemoveFromTicking(); 324 RemoveFromTicking();
325 } 325 }
326 } 326 }
327 } 327 }
328 328
329 void AnimationPlayer::RemoveFromTicking() { 329 void AnimationPlayer::RemoveFromTicking() {
330 DCHECK(animation_host_); 330 DCHECK(animation_host_);
331 // Resetting last_tick_time_ here ensures that calling ::UpdateState 331 // Resetting last_tick_time_ here ensures that calling ::UpdateState
332 // before ::Animate doesn't start an animation. 332 // before ::Animate doesn't start an animation.
333 is_ticking_ = false;
333 last_tick_time_ = base::TimeTicks(); 334 last_tick_time_ = base::TimeTicks();
334 animation_host_->RemoveFromTicking(this); 335 animation_host_->RemoveFromTicking(this);
335 } 336 }
336 337
337 bool AnimationPlayer::NotifyAnimationStarted(const AnimationEvent& event) { 338 bool AnimationPlayer::NotifyAnimationStarted(const AnimationEvent& event) {
338 DCHECK(!event.is_impl_only); 339 DCHECK(!event.is_impl_only);
339 340
340 for (size_t i = 0; i < animations_.size(); ++i) { 341 for (size_t i = 0; i < animations_.size(); ++i) {
341 if (animations_[i]->group() == event.group_id && 342 if (animations_[i]->group() == event.group_id &&
342 animations_[i]->target_property() == event.target_property && 343 animations_[i]->target_property() == event.target_property &&
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 if (current_impl) 1196 if (current_impl)
1196 animations_[i]->PushPropertiesTo(current_impl); 1197 animations_[i]->PushPropertiesTo(current_impl);
1197 } 1198 }
1198 1199
1199 animation_player_impl->scroll_offset_animation_was_interrupted_ = 1200 animation_player_impl->scroll_offset_animation_was_interrupted_ =
1200 scroll_offset_animation_was_interrupted_; 1201 scroll_offset_animation_was_interrupted_;
1201 scroll_offset_animation_was_interrupted_ = false; 1202 scroll_offset_animation_was_interrupted_ = false;
1202 } 1203 }
1203 1204
1204 } // namespace cc 1205 } // 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