| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/proxy_main.h" | 5 #include "cc/trees/proxy_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| 11 #include "base/trace_event/trace_event_argument.h" | 11 #include "base/trace_event/trace_event_argument.h" |
| 12 #include "base/trace_event/trace_event_synthetic_delay.h" | 12 #include "base/trace_event/trace_event_synthetic_delay.h" |
| 13 #include "cc/animation/animation_events.h" | 13 #include "cc/animation/animation_events.h" |
| 14 #include "cc/debug/benchmark_instrumentation.h" | 14 #include "cc/debug/benchmark_instrumentation.h" |
| 15 #include "cc/debug/devtools_instrumentation.h" | 15 #include "cc/debug/devtools_instrumentation.h" |
| 16 #include "cc/output/output_surface.h" | 16 #include "cc/output/output_surface.h" |
| 17 #include "cc/output/swap_promise.h" | 17 #include "cc/output/swap_promise.h" |
| 18 #include "cc/resources/ui_resource_manager.h" |
| 18 #include "cc/trees/blocking_task_runner.h" | 19 #include "cc/trees/blocking_task_runner.h" |
| 19 #include "cc/trees/layer_tree_host.h" | 20 #include "cc/trees/layer_tree_host.h" |
| 20 #include "cc/trees/remote_channel_main.h" | 21 #include "cc/trees/remote_channel_main.h" |
| 21 #include "cc/trees/scoped_abort_remaining_swap_promises.h" | 22 #include "cc/trees/scoped_abort_remaining_swap_promises.h" |
| 22 #include "cc/trees/threaded_channel.h" | 23 #include "cc/trees/threaded_channel.h" |
| 23 | 24 |
| 24 namespace cc { | 25 namespace cc { |
| 25 | 26 |
| 26 std::unique_ptr<ProxyMain> ProxyMain::CreateThreaded( | 27 std::unique_ptr<ProxyMain> ProxyMain::CreateThreaded( |
| 27 LayerTreeHost* layer_tree_host, | 28 LayerTreeHost* layer_tree_host, |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 172 |
| 172 layer_tree_host_->WillBeginMainFrame(); | 173 layer_tree_host_->WillBeginMainFrame(); |
| 173 | 174 |
| 174 layer_tree_host_->BeginMainFrame(begin_main_frame_state->begin_frame_args); | 175 layer_tree_host_->BeginMainFrame(begin_main_frame_state->begin_frame_args); |
| 175 layer_tree_host_->AnimateLayers( | 176 layer_tree_host_->AnimateLayers( |
| 176 begin_main_frame_state->begin_frame_args.frame_time); | 177 begin_main_frame_state->begin_frame_args.frame_time); |
| 177 | 178 |
| 178 // Recreate all UI resources if there were evicted UI resources when the impl | 179 // Recreate all UI resources if there were evicted UI resources when the impl |
| 179 // thread initiated the commit. | 180 // thread initiated the commit. |
| 180 if (begin_main_frame_state->evicted_ui_resources) | 181 if (begin_main_frame_state->evicted_ui_resources) |
| 181 layer_tree_host_->RecreateUIResources(); | 182 layer_tree_host_->GetUIResourceManager()->RecreateUIResources(); |
| 182 | 183 |
| 183 layer_tree_host_->RequestMainFrameUpdate(); | 184 layer_tree_host_->RequestMainFrameUpdate(); |
| 184 TRACE_EVENT_SYNTHETIC_DELAY_END("cc.BeginMainFrame"); | 185 TRACE_EVENT_SYNTHETIC_DELAY_END("cc.BeginMainFrame"); |
| 185 | 186 |
| 186 bool can_cancel_this_commit = final_pipeline_stage_ < COMMIT_PIPELINE_STAGE && | 187 bool can_cancel_this_commit = final_pipeline_stage_ < COMMIT_PIPELINE_STAGE && |
| 187 !begin_main_frame_state->evicted_ui_resources; | 188 !begin_main_frame_state->evicted_ui_resources; |
| 188 | 189 |
| 189 current_pipeline_stage_ = UPDATE_LAYERS_PIPELINE_STAGE; | 190 current_pipeline_stage_ = UPDATE_LAYERS_PIPELINE_STAGE; |
| 190 bool should_update_layers = | 191 bool should_update_layers = |
| 191 final_pipeline_stage_ >= UPDATE_LAYERS_PIPELINE_STAGE; | 192 final_pipeline_stage_ >= UPDATE_LAYERS_PIPELINE_STAGE; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 return false; | 421 return false; |
| 421 channel_main_->SetNeedsCommitOnImpl(); | 422 channel_main_->SetNeedsCommitOnImpl(); |
| 422 return true; | 423 return true; |
| 423 } | 424 } |
| 424 | 425 |
| 425 bool ProxyMain::IsMainThread() const { | 426 bool ProxyMain::IsMainThread() const { |
| 426 return task_runner_provider_->IsMainThread(); | 427 return task_runner_provider_->IsMainThread(); |
| 427 } | 428 } |
| 428 | 429 |
| 429 } // namespace cc | 430 } // namespace cc |
| OLD | NEW |