| 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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| 11 #include "cc/animation/animation_events.h" | 11 #include "cc/animation/animation_events.h" |
| 12 #include "cc/debug/benchmark_instrumentation.h" | 12 #include "cc/debug/benchmark_instrumentation.h" |
| 13 #include "cc/debug/devtools_instrumentation.h" | 13 #include "cc/debug/devtools_instrumentation.h" |
| 14 #include "cc/output/context_provider.h" | 14 #include "cc/output/context_provider.h" |
| 15 #include "cc/output/output_surface.h" | 15 #include "cc/output/output_surface.h" |
| 16 #include "cc/quads/draw_quad.h" | 16 #include "cc/quads/draw_quad.h" |
| 17 #include "cc/resources/ui_resource_manager.h" |
| 17 #include "cc/scheduler/commit_earlyout_reason.h" | 18 #include "cc/scheduler/commit_earlyout_reason.h" |
| 18 #include "cc/scheduler/compositor_timing_history.h" | 19 #include "cc/scheduler/compositor_timing_history.h" |
| 19 #include "cc/scheduler/delay_based_time_source.h" | 20 #include "cc/scheduler/delay_based_time_source.h" |
| 20 #include "cc/scheduler/scheduler.h" | 21 #include "cc/scheduler/scheduler.h" |
| 21 #include "cc/trees/layer_tree_host.h" | 22 #include "cc/trees/layer_tree_host.h" |
| 22 #include "cc/trees/layer_tree_host_common.h" | 23 #include "cc/trees/layer_tree_host_common.h" |
| 23 #include "cc/trees/layer_tree_host_single_thread_client.h" | 24 #include "cc/trees/layer_tree_host_single_thread_client.h" |
| 24 #include "cc/trees/layer_tree_impl.h" | 25 #include "cc/trees/layer_tree_impl.h" |
| 25 #include "cc/trees/scoped_abort_remaining_swap_promises.h" | 26 #include "cc/trees/scoped_abort_remaining_swap_promises.h" |
| 26 | 27 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // This CapturePostTasks should be destroyed before CommitComplete() is | 199 // This CapturePostTasks should be destroyed before CommitComplete() is |
| 199 // called since that goes out to the embedder, and we want the embedder | 200 // called since that goes out to the embedder, and we want the embedder |
| 200 // to receive its callbacks before that. | 201 // to receive its callbacks before that. |
| 201 commit_blocking_task_runner_.reset(new BlockingTaskRunner::CapturePostTasks( | 202 commit_blocking_task_runner_.reset(new BlockingTaskRunner::CapturePostTasks( |
| 202 task_runner_provider_->blocking_main_thread_task_runner())); | 203 task_runner_provider_->blocking_main_thread_task_runner())); |
| 203 | 204 |
| 204 layer_tree_host_impl_->ReadyToCommit(); | 205 layer_tree_host_impl_->ReadyToCommit(); |
| 205 layer_tree_host_impl_->BeginCommit(); | 206 layer_tree_host_impl_->BeginCommit(); |
| 206 | 207 |
| 207 if (layer_tree_host_impl_->EvictedUIResourcesExist()) | 208 if (layer_tree_host_impl_->EvictedUIResourcesExist()) |
| 208 layer_tree_host_->RecreateUIResources(); | 209 layer_tree_host_->GetUIResourceManager()->RecreateUIResources(); |
| 209 | 210 |
| 210 layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get()); | 211 layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get()); |
| 211 | 212 |
| 212 if (scheduler_on_impl_thread_) | 213 if (scheduler_on_impl_thread_) |
| 213 scheduler_on_impl_thread_->DidCommit(); | 214 scheduler_on_impl_thread_->DidCommit(); |
| 214 | 215 |
| 215 layer_tree_host_impl_->CommitComplete(); | 216 layer_tree_host_impl_->CommitComplete(); |
| 216 | 217 |
| 217 // Commit goes directly to the active tree, but we need to synchronously | 218 // Commit goes directly to the active tree, but we need to synchronously |
| 218 // "activate" the tree still during commit to satisfy any potential | 219 // "activate" the tree still during commit to satisfy any potential |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 void SingleThreadProxy::DidFinishImplFrame() { | 765 void SingleThreadProxy::DidFinishImplFrame() { |
| 765 layer_tree_host_impl_->DidFinishImplFrame(); | 766 layer_tree_host_impl_->DidFinishImplFrame(); |
| 766 #if DCHECK_IS_ON() | 767 #if DCHECK_IS_ON() |
| 767 DCHECK(inside_impl_frame_) | 768 DCHECK(inside_impl_frame_) |
| 768 << "DidFinishImplFrame called while not inside an impl frame!"; | 769 << "DidFinishImplFrame called while not inside an impl frame!"; |
| 769 inside_impl_frame_ = false; | 770 inside_impl_frame_ = false; |
| 770 #endif | 771 #endif |
| 771 } | 772 } |
| 772 | 773 |
| 773 } // namespace cc | 774 } // namespace cc |
| OLD | NEW |