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

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

Issue 26880010: gfx: Add FrameTime and DisplayTime classes (Closed) Base URL: http://git.chromium.org/chromium/src.git@checkHighResNow4
Patch Set: WIP Created 7 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 | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('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 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 void LayerTreeHost::AcquireLayerTextures() { 259 void LayerTreeHost::AcquireLayerTextures() {
260 DCHECK(proxy_->IsMainThread()); 260 DCHECK(proxy_->IsMainThread());
261 proxy_->AcquireLayerTextures(); 261 proxy_->AcquireLayerTextures();
262 } 262 }
263 263
264 void LayerTreeHost::DidBeginMainFrame() { 264 void LayerTreeHost::DidBeginMainFrame() {
265 client_->DidBeginMainFrame(); 265 client_->DidBeginMainFrame();
266 } 266 }
267 267
268 void LayerTreeHost::UpdateClientAnimations(base::TimeTicks frame_begin_time) { 268 void LayerTreeHost::UpdateClientAnimations(gfx::FrameTime frame_begin_time) {
269 animating_ = true; 269 animating_ = true;
270 client_->Animate((frame_begin_time - base::TimeTicks()).InSecondsF()); 270 client_->Animate(frame_begin_time.Unsafe_InSecondsF());
271 animating_ = false; 271 animating_ = false;
272 } 272 }
273 273
274 void LayerTreeHost::DidStopFlinging() { 274 void LayerTreeHost::DidStopFlinging() {
275 proxy_->MainThreadHasStoppedFlinging(); 275 proxy_->MainThreadHasStoppedFlinging();
276 } 276 }
277 277
278 void LayerTreeHost::Layout() { 278 void LayerTreeHost::Layout() {
279 client_->Layout(); 279 client_->Layout();
280 } 280 }
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 pending_page_scale_animation_->scale = scale; 721 pending_page_scale_animation_->scale = scale;
722 pending_page_scale_animation_->duration = duration; 722 pending_page_scale_animation_->duration = duration;
723 723
724 SetNeedsCommit(); 724 SetNeedsCommit();
725 } 725 }
726 726
727 void LayerTreeHost::NotifyInputThrottledUntilCommit() { 727 void LayerTreeHost::NotifyInputThrottledUntilCommit() {
728 proxy_->NotifyInputThrottledUntilCommit(); 728 proxy_->NotifyInputThrottledUntilCommit();
729 } 729 }
730 730
731 void LayerTreeHost::Composite(base::TimeTicks frame_begin_time) { 731 void LayerTreeHost::Composite(gfx::FrameTime frame_begin_time) {
732 if (!proxy_->HasImplThread()) 732 if (!proxy_->HasImplThread())
733 static_cast<SingleThreadProxy*>(proxy_.get())->CompositeImmediately( 733 static_cast<SingleThreadProxy*>(proxy_.get())->CompositeImmediately(
734 frame_begin_time); 734 frame_begin_time);
735 else 735 else
736 SetNeedsCommit(); 736 SetNeedsCommit();
737 } 737 }
738 738
739 void LayerTreeHost::ScheduleComposite() { 739 void LayerTreeHost::ScheduleComposite() {
740 client_->ScheduleComposite(); 740 client_->ScheduleComposite();
741 } 741 }
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 current, 1184 current,
1185 animate)); 1185 animate));
1186 } 1186 }
1187 1187
1188 scoped_ptr<base::Value> LayerTreeHost::AsValue() const { 1188 scoped_ptr<base::Value> LayerTreeHost::AsValue() const {
1189 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 1189 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
1190 state->Set("proxy", proxy_->AsValue().release()); 1190 state->Set("proxy", proxy_->AsValue().release());
1191 return state.PassAs<base::Value>(); 1191 return state.PassAs<base::Value>();
1192 } 1192 }
1193 1193
1194 void LayerTreeHost::AnimateLayers(base::TimeTicks time) { 1194 void LayerTreeHost::AnimateLayers(gfx::FrameTime time) {
1195 if (!settings_.accelerated_animation_enabled || 1195 if (!settings_.accelerated_animation_enabled ||
1196 animation_registrar_->active_animation_controllers().empty()) 1196 animation_registrar_->active_animation_controllers().empty())
1197 return; 1197 return;
1198 1198
1199 TRACE_EVENT0("cc", "LayerTreeHost::AnimateLayers"); 1199 TRACE_EVENT0("cc", "LayerTreeHost::AnimateLayers");
1200 1200
1201 double monotonic_time = (time - base::TimeTicks()).InSecondsF(); 1201 double monotonic_time = time.Unsafe_InSecondsF();
1202 1202
1203 AnimationRegistrar::AnimationControllerMap copy = 1203 AnimationRegistrar::AnimationControllerMap copy =
1204 animation_registrar_->active_animation_controllers(); 1204 animation_registrar_->active_animation_controllers();
1205 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(); 1205 for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin();
1206 iter != copy.end(); 1206 iter != copy.end();
1207 ++iter) { 1207 ++iter) {
1208 (*iter).second->Animate(monotonic_time); 1208 (*iter).second->Animate(monotonic_time);
1209 bool start_ready_animations = true; 1209 bool start_ready_animations = true;
1210 (*iter).second->UpdateState(start_ready_animations, NULL); 1210 (*iter).second->UpdateState(start_ready_animations, NULL);
1211 } 1211 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 1278
1279 bool LayerTreeHost::ScheduleMicroBenchmark( 1279 bool LayerTreeHost::ScheduleMicroBenchmark(
1280 const std::string& benchmark_name, 1280 const std::string& benchmark_name,
1281 scoped_ptr<base::Value> value, 1281 scoped_ptr<base::Value> value,
1282 const MicroBenchmark::DoneCallback& callback) { 1282 const MicroBenchmark::DoneCallback& callback) {
1283 return micro_benchmark_controller_.ScheduleRun( 1283 return micro_benchmark_controller_.ScheduleRun(
1284 benchmark_name, value.Pass(), callback); 1284 benchmark_name, value.Pass(), callback);
1285 } 1285 }
1286 1286
1287 } // namespace cc 1287 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698