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

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

Issue 595973002: Moving background animation ticking from LayerTreeHostImpl into the Scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scheduler-timesource-refactor
Patch Set: Small fixes. Created 6 years, 1 month 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 | cc/scheduler/scheduler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <vector> 8 #include <vector>
9 9
10 #include "cc/animation/animation.h" 10 #include "cc/animation/animation.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 NOTREACHED(); 205 NOTREACHED();
206 } 206 }
207 } 207 }
208 } 208 }
209 209
210 void LayerAnimationController::UpdateState(bool start_ready_animations, 210 void LayerAnimationController::UpdateState(bool start_ready_animations,
211 AnimationEventsVector* events) { 211 AnimationEventsVector* events) {
212 if (!HasActiveValueObserver()) 212 if (!HasActiveValueObserver())
213 return; 213 return;
214 214
215 DCHECK(last_tick_time_ != base::TimeTicks()); 215 // Animate hasn't been called, this happens if an observer has been added
216 // between the Commit and Draw phases.
217 if (last_tick_time_ == base::TimeTicks())
218 return;
219
216 if (start_ready_animations) 220 if (start_ready_animations)
217 PromoteStartedAnimations(last_tick_time_, events); 221 PromoteStartedAnimations(last_tick_time_, events);
218 222
219 MarkFinishedAnimations(last_tick_time_); 223 MarkFinishedAnimations(last_tick_time_);
220 MarkAnimationsForDeletion(last_tick_time_, events); 224 MarkAnimationsForDeletion(last_tick_time_, events);
221 225
222 if (needs_to_start_animations_ && start_ready_animations) { 226 if (needs_to_start_animations_ && start_ready_animations) {
223 StartAnimations(last_tick_time_); 227 StartAnimations(last_tick_time_);
224 PromoteStartedAnimations(last_tick_time_, events); 228 PromoteStartedAnimations(last_tick_time_, events);
225 } 229 }
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 value_observers_); 1033 value_observers_);
1030 LayerAnimationValueObserver* obs; 1034 LayerAnimationValueObserver* obs;
1031 while ((obs = it.GetNext()) != nullptr) 1035 while ((obs = it.GetNext()) != nullptr)
1032 if (obs->IsActive()) 1036 if (obs->IsActive())
1033 return true; 1037 return true;
1034 } 1038 }
1035 return false; 1039 return false;
1036 } 1040 }
1037 1041
1038 } // namespace cc 1042 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/scheduler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698