| 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/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "cc/debug/benchmark_instrumentation.h" | 9 #include "cc/debug/benchmark_instrumentation.h" |
| 10 #include "cc/debug/devtools_instrumentation.h" |
| 10 #include "cc/output/context_provider.h" | 11 #include "cc/output/context_provider.h" |
| 11 #include "cc/output/output_surface.h" | 12 #include "cc/output/output_surface.h" |
| 12 #include "cc/quads/draw_quad.h" | 13 #include "cc/quads/draw_quad.h" |
| 13 #include "cc/resources/prioritized_resource_manager.h" | 14 #include "cc/resources/prioritized_resource_manager.h" |
| 14 #include "cc/resources/resource_update_controller.h" | 15 #include "cc/resources/resource_update_controller.h" |
| 15 #include "cc/scheduler/commit_earlyout_reason.h" | 16 #include "cc/scheduler/commit_earlyout_reason.h" |
| 16 #include "cc/trees/layer_tree_host.h" | 17 #include "cc/trees/layer_tree_host.h" |
| 17 #include "cc/trees/layer_tree_host_single_thread_client.h" | 18 #include "cc/trees/layer_tree_host_single_thread_client.h" |
| 18 #include "cc/trees/layer_tree_impl.h" | 19 #include "cc/trees/layer_tree_impl.h" |
| 19 #include "cc/trees/scoped_abort_remaining_swap_promises.h" | 20 #include "cc/trees/scoped_abort_remaining_swap_promises.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 layer_tree_host_impl_->UpdateAnimationState(true); | 198 layer_tree_host_impl_->UpdateAnimationState(true); |
| 198 } | 199 } |
| 199 } | 200 } |
| 200 | 201 |
| 201 void SingleThreadProxy::DoCommit() { | 202 void SingleThreadProxy::DoCommit() { |
| 202 TRACE_EVENT0("cc", "SingleThreadProxy::DoCommit"); | 203 TRACE_EVENT0("cc", "SingleThreadProxy::DoCommit"); |
| 203 DCHECK(Proxy::IsMainThread()); | 204 DCHECK(Proxy::IsMainThread()); |
| 204 | 205 |
| 205 commit_requested_ = false; | 206 commit_requested_ = false; |
| 206 layer_tree_host_->WillCommit(); | 207 layer_tree_host_->WillCommit(); |
| 208 devtools_instrumentation::ScopedCommitTrace commit_task( |
| 209 layer_tree_host_->id()); |
| 207 | 210 |
| 208 // Commit immediately. | 211 // Commit immediately. |
| 209 { | 212 { |
| 210 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 213 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
| 211 DebugScopedSetImplThread impl(this); | 214 DebugScopedSetImplThread impl(this); |
| 212 | 215 |
| 213 // This CapturePostTasks should be destroyed before CommitComplete() is | 216 // This CapturePostTasks should be destroyed before CommitComplete() is |
| 214 // called since that goes out to the embedder, and we want the embedder | 217 // called since that goes out to the embedder, and we want the embedder |
| 215 // to receive its callbacks before that. | 218 // to receive its callbacks before that. |
| 216 commit_blocking_task_runner_.reset(new BlockingTaskRunner::CapturePostTasks( | 219 commit_blocking_task_runner_.reset(new BlockingTaskRunner::CapturePostTasks( |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 | 818 |
| 816 void SingleThreadProxy::DidBeginImplFrameDeadline() { | 819 void SingleThreadProxy::DidBeginImplFrameDeadline() { |
| 817 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); | 820 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
| 818 } | 821 } |
| 819 | 822 |
| 820 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 823 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
| 821 layer_tree_host_->SendBeginFramesToChildren(args); | 824 layer_tree_host_->SendBeginFramesToChildren(args); |
| 822 } | 825 } |
| 823 | 826 |
| 824 } // namespace cc | 827 } // namespace cc |
| OLD | NEW |