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 |
293 // Notify commit complete on the impl side after activate to satisfy any | 296 // Notify commit complete on the impl side after activate to satisfy any |
294 // SetNextCommitWaitsForActivation calls. | 297 // SetNextCommitWaitsForActivation calls. |
295 layer_tree_host_impl_->CommitComplete(); | 298 layer_tree_host_impl_->CommitComplete(); |
296 | 299 |
297 DebugScopedSetMainThread main(this); | 300 DebugScopedSetMainThread main(this); |
298 commit_blocking_task_runner_.reset(); | 301 commit_blocking_task_runner_.reset(); |
299 layer_tree_host_->CommitComplete(); | 302 layer_tree_host_->CommitComplete(); |
300 layer_tree_host_->DidBeginMainFrame(); | 303 layer_tree_host_->DidBeginMainFrame(); |
301 | 304 |
302 next_frame_is_newly_committed_frame_ = true; | 305 next_frame_is_newly_committed_frame_ = true; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 // after commit since single thread commits directly to the active tree. | 451 // after commit since single thread commits directly to the active tree. |
449 if (scheduler_on_impl_thread_) | 452 if (scheduler_on_impl_thread_) |
450 scheduler_on_impl_thread_->SetWaitForReadyToDraw(); | 453 scheduler_on_impl_thread_->SetWaitForReadyToDraw(); |
451 | 454 |
452 // Synchronously call to CommitComplete. Resetting | 455 // Synchronously call to CommitComplete. Resetting |
453 // |commit_blocking_task_runner| would make sure all tasks posted during | 456 // |commit_blocking_task_runner| would make sure all tasks posted during |
454 // commit/activation before CommitComplete. | 457 // commit/activation before CommitComplete. |
455 CommitComplete(); | 458 CommitComplete(); |
456 } | 459 } |
457 | 460 |
| 461 void SingleThreadProxy::WillPrepareTiles() { |
| 462 DCHECK(Proxy::IsImplThread()); |
| 463 if (scheduler_on_impl_thread_) |
| 464 scheduler_on_impl_thread_->WillPrepareTiles(); |
| 465 } |
| 466 |
458 void SingleThreadProxy::DidPrepareTiles() { | 467 void SingleThreadProxy::DidPrepareTiles() { |
459 DCHECK(Proxy::IsImplThread()); | 468 DCHECK(Proxy::IsImplThread()); |
460 if (scheduler_on_impl_thread_) | 469 if (scheduler_on_impl_thread_) |
461 scheduler_on_impl_thread_->DidPrepareTiles(); | 470 scheduler_on_impl_thread_->DidPrepareTiles(); |
462 } | 471 } |
463 | 472 |
464 void SingleThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 473 void SingleThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
465 layer_tree_host_->DidCompletePageScaleAnimation(); | 474 layer_tree_host_->DidCompletePageScaleAnimation(); |
466 } | 475 } |
467 | 476 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 << "DidFinishImplFrame called while not inside an impl frame!"; | 909 << "DidFinishImplFrame called while not inside an impl frame!"; |
901 inside_impl_frame_ = false; | 910 inside_impl_frame_ = false; |
902 #endif | 911 #endif |
903 } | 912 } |
904 | 913 |
905 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 914 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
906 layer_tree_host_->SendBeginFramesToChildren(args); | 915 layer_tree_host_->SendBeginFramesToChildren(args); |
907 } | 916 } |
908 | 917 |
909 } // namespace cc | 918 } // namespace cc |
OLD | NEW |