| 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/single_thread_proxy.h" | 5 #include "cc/trees/single_thread_proxy.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/profiler/scoped_tracker.h" | 8 #include "base/profiler/scoped_tracker.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/debug/benchmark_instrumentation.h" | 10 #include "cc/debug/benchmark_instrumentation.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 // the flag to force the tree to not draw until textures are ready. | 283 // the flag to force the tree to not draw until textures are ready. |
| 284 NotifyReadyToActivate(); | 284 NotifyReadyToActivate(); |
| 285 } | 285 } |
| 286 } | 286 } |
| 287 | 287 |
| 288 void SingleThreadProxy::CommitComplete() { | 288 void SingleThreadProxy::CommitComplete() { |
| 289 DCHECK(!layer_tree_host_impl_->pending_tree()) | 289 DCHECK(!layer_tree_host_impl_->pending_tree()) |
| 290 << "Activation is expected to have synchronously occurred by now."; | 290 << "Activation is expected to have synchronously occurred by now."; |
| 291 DCHECK(commit_blocking_task_runner_); | 291 DCHECK(commit_blocking_task_runner_); |
| 292 | 292 |
| 293 if (scheduler_on_impl_thread_) | |
| 294 scheduler_on_impl_thread_->DidCommit(); | |
| 295 | |
| 296 // Notify commit complete on the impl side after activate to satisfy any | 293 // Notify commit complete on the impl side after activate to satisfy any |
| 297 // SetNextCommitWaitsForActivation calls. | 294 // SetNextCommitWaitsForActivation calls. |
| 298 layer_tree_host_impl_->CommitComplete(); | 295 layer_tree_host_impl_->CommitComplete(); |
| 299 | 296 |
| 300 DebugScopedSetMainThread main(this); | 297 DebugScopedSetMainThread main(this); |
| 301 commit_blocking_task_runner_.reset(); | 298 commit_blocking_task_runner_.reset(); |
| 302 layer_tree_host_->CommitComplete(); | 299 layer_tree_host_->CommitComplete(); |
| 303 layer_tree_host_->DidBeginMainFrame(); | 300 layer_tree_host_->DidBeginMainFrame(); |
| 304 | 301 |
| 305 next_frame_is_newly_committed_frame_ = true; | 302 next_frame_is_newly_committed_frame_ = true; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 // after commit since single thread commits directly to the active tree. | 448 // after commit since single thread commits directly to the active tree. |
| 452 if (scheduler_on_impl_thread_) | 449 if (scheduler_on_impl_thread_) |
| 453 scheduler_on_impl_thread_->SetWaitForReadyToDraw(); | 450 scheduler_on_impl_thread_->SetWaitForReadyToDraw(); |
| 454 | 451 |
| 455 // Synchronously call to CommitComplete. Resetting | 452 // Synchronously call to CommitComplete. Resetting |
| 456 // |commit_blocking_task_runner| would make sure all tasks posted during | 453 // |commit_blocking_task_runner| would make sure all tasks posted during |
| 457 // commit/activation before CommitComplete. | 454 // commit/activation before CommitComplete. |
| 458 CommitComplete(); | 455 CommitComplete(); |
| 459 } | 456 } |
| 460 | 457 |
| 461 void SingleThreadProxy::WillPrepareTiles() { | |
| 462 DCHECK(Proxy::IsImplThread()); | |
| 463 if (scheduler_on_impl_thread_) | |
| 464 scheduler_on_impl_thread_->WillPrepareTiles(); | |
| 465 } | |
| 466 | |
| 467 void SingleThreadProxy::DidPrepareTiles() { | 458 void SingleThreadProxy::DidPrepareTiles() { |
| 468 DCHECK(Proxy::IsImplThread()); | 459 DCHECK(Proxy::IsImplThread()); |
| 469 if (scheduler_on_impl_thread_) | 460 if (scheduler_on_impl_thread_) |
| 470 scheduler_on_impl_thread_->DidPrepareTiles(); | 461 scheduler_on_impl_thread_->DidPrepareTiles(); |
| 471 } | 462 } |
| 472 | 463 |
| 473 void SingleThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 464 void SingleThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
| 474 layer_tree_host_->DidCompletePageScaleAnimation(); | 465 layer_tree_host_->DidCompletePageScaleAnimation(); |
| 475 } | 466 } |
| 476 | 467 |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 << "DidFinishImplFrame called while not inside an impl frame!"; | 900 << "DidFinishImplFrame called while not inside an impl frame!"; |
| 910 inside_impl_frame_ = false; | 901 inside_impl_frame_ = false; |
| 911 #endif | 902 #endif |
| 912 } | 903 } |
| 913 | 904 |
| 914 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 905 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
| 915 layer_tree_host_->SendBeginFramesToChildren(args); | 906 layer_tree_host_->SendBeginFramesToChildren(args); |
| 916 } | 907 } |
| 917 | 908 |
| 918 } // namespace cc | 909 } // namespace cc |
| OLD | NEW |