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

Side by Side Diff: cc/trees/layer_tree_host.cc

Issue 231133002: CC::Animations should use TimeTicks & TimeDelta to represent time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review changes. Created 6 years, 7 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 #include <string> 9 #include <string>
10 10
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 current, 1111 current,
1112 animate)); 1112 animate));
1113 } 1113 }
1114 1114
1115 scoped_ptr<base::Value> LayerTreeHost::AsValue() const { 1115 scoped_ptr<base::Value> LayerTreeHost::AsValue() const {
1116 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 1116 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
1117 state->Set("proxy", proxy_->AsValue().release()); 1117 state->Set("proxy", proxy_->AsValue().release());
1118 return state.PassAs<base::Value>(); 1118 return state.PassAs<base::Value>();
1119 } 1119 }
1120 1120
1121 void LayerTreeHost::AnimateLayers(base::TimeTicks time) { 1121 void LayerTreeHost::AnimateLayers(base::TimeTicks monotonic_time) {
1122 if (!settings_.accelerated_animation_enabled || 1122 if (!settings_.accelerated_animation_enabled ||
1123 animation_registrar_->active_animation_controllers().empty()) 1123 animation_registrar_->active_animation_controllers().empty())
1124 return; 1124 return;
1125 1125
1126 TRACE_EVENT0("cc", "LayerTreeHost::AnimateLayers"); 1126 TRACE_EVENT0("cc", "LayerTreeHost::AnimateLayers");
1127 1127
1128 double monotonic_time = (time - base::TimeTicks()).InSecondsF();
1129
1130 AnimationRegistrar::AnimationControllerMap copy = 1128 AnimationRegistrar::AnimationControllerMap copy =
1131 animation_registrar_->active_animation_controllers(); 1129 animation_registrar_->active_animation_controllers();
1132 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(); 1130 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin();
1133 iter != copy.end(); 1131 iter != copy.end();
1134 ++iter) { 1132 ++iter) {
1135 (*iter).second->Animate(monotonic_time); 1133 (*iter).second->Animate(monotonic_time);
1136 bool start_ready_animations = true; 1134 bool start_ready_animations = true;
1137 (*iter).second->UpdateState(start_ready_animations, NULL); 1135 (*iter).second->UpdateState(start_ready_animations, NULL);
1138 } 1136 }
1139 } 1137 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 swap_promise_list_.push_back(swap_promise.Pass()); 1230 swap_promise_list_.push_back(swap_promise.Pass());
1233 } 1231 }
1234 1232
1235 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { 1233 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
1236 for (size_t i = 0; i < swap_promise_list_.size(); i++) 1234 for (size_t i = 0; i < swap_promise_list_.size(); i++)
1237 swap_promise_list_[i]->DidNotSwap(reason); 1235 swap_promise_list_[i]->DidNotSwap(reason);
1238 swap_promise_list_.clear(); 1236 swap_promise_list_.clear();
1239 } 1237 }
1240 1238
1241 } // namespace cc 1239 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698