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

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

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