OLD | NEW |
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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 current, | 1132 current, |
1133 animate)); | 1133 animate)); |
1134 } | 1134 } |
1135 | 1135 |
1136 scoped_ptr<base::Value> LayerTreeHost::AsValue() const { | 1136 scoped_ptr<base::Value> LayerTreeHost::AsValue() const { |
1137 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1137 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1138 state->Set("proxy", proxy_->AsValue().release()); | 1138 state->Set("proxy", proxy_->AsValue().release()); |
1139 return state.PassAs<base::Value>(); | 1139 return state.PassAs<base::Value>(); |
1140 } | 1140 } |
1141 | 1141 |
1142 void LayerTreeHost::AnimateLayers(base::TimeTicks time) { | 1142 void LayerTreeHost::AnimateLayers(base::TimeTicks monotonic_time) { |
1143 if (!settings_.accelerated_animation_enabled || | 1143 if (!settings_.accelerated_animation_enabled || |
1144 animation_registrar_->active_animation_controllers().empty()) | 1144 animation_registrar_->active_animation_controllers().empty()) |
1145 return; | 1145 return; |
1146 | 1146 |
1147 TRACE_EVENT0("cc", "LayerTreeHost::AnimateLayers"); | 1147 TRACE_EVENT0("cc", "LayerTreeHost::AnimateLayers"); |
1148 | 1148 |
1149 double monotonic_time = (time - base::TimeTicks()).InSecondsF(); | |
1150 | |
1151 AnimationRegistrar::AnimationControllerMap copy = | 1149 AnimationRegistrar::AnimationControllerMap copy = |
1152 animation_registrar_->active_animation_controllers(); | 1150 animation_registrar_->active_animation_controllers(); |
1153 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(); | 1151 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(); |
1154 iter != copy.end(); | 1152 iter != copy.end(); |
1155 ++iter) { | 1153 ++iter) { |
1156 (*iter).second->Animate(monotonic_time); | 1154 (*iter).second->Animate(monotonic_time); |
1157 bool start_ready_animations = true; | 1155 bool start_ready_animations = true; |
1158 (*iter).second->UpdateState(start_ready_animations, NULL); | 1156 (*iter).second->UpdateState(start_ready_animations, NULL); |
1159 } | 1157 } |
1160 } | 1158 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 swap_promise_list_.push_back(swap_promise.Pass()); | 1251 swap_promise_list_.push_back(swap_promise.Pass()); |
1254 } | 1252 } |
1255 | 1253 |
1256 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1254 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
1257 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1255 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
1258 swap_promise_list_[i]->DidNotSwap(reason); | 1256 swap_promise_list_[i]->DidNotSwap(reason); |
1259 swap_promise_list_.clear(); | 1257 swap_promise_list_.clear(); |
1260 } | 1258 } |
1261 | 1259 |
1262 } // namespace cc | 1260 } // namespace cc |
OLD | NEW |