| 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" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; | 139 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; |
| 140 channel_main_->BeginMainFrameAbortedOnImpl( | 140 channel_main_->BeginMainFrameAbortedOnImpl( |
| 141 CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT, | 141 CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT, |
| 142 begin_main_frame_start_time, std::move(empty_swap_promises)); | 142 begin_main_frame_start_time, std::move(empty_swap_promises)); |
| 143 return; | 143 return; |
| 144 } | 144 } |
| 145 | 145 |
| 146 // If the commit finishes, LayerTreeHost will transfer its swap promises to | 146 // If the commit finishes, LayerTreeHost will transfer its swap promises to |
| 147 // LayerTreeImpl. The destructor of ScopedSwapPromiseChecker aborts the | 147 // LayerTreeImpl. The destructor of ScopedSwapPromiseChecker aborts the |
| 148 // remaining swap promises. | 148 // remaining swap promises. |
| 149 ScopedAbortRemainingSwapPromises swap_promise_checker(layer_tree_host_); | 149 ScopedAbortRemainingSwapPromises swap_promise_checker( |
| 150 layer_tree_host_->GetSwapPromiseManager()); |
| 150 | 151 |
| 151 final_pipeline_stage_ = max_requested_pipeline_stage_; | 152 final_pipeline_stage_ = max_requested_pipeline_stage_; |
| 152 max_requested_pipeline_stage_ = NO_PIPELINE_STAGE; | 153 max_requested_pipeline_stage_ = NO_PIPELINE_STAGE; |
| 153 | 154 |
| 154 if (!layer_tree_host_->IsVisible()) { | 155 if (!layer_tree_host_->IsVisible()) { |
| 155 TRACE_EVENT_INSTANT0("cc", "EarlyOut_NotVisible", TRACE_EVENT_SCOPE_THREAD); | 156 TRACE_EVENT_INSTANT0("cc", "EarlyOut_NotVisible", TRACE_EVENT_SCOPE_THREAD); |
| 156 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; | 157 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; |
| 157 channel_main_->BeginMainFrameAbortedOnImpl( | 158 channel_main_->BeginMainFrameAbortedOnImpl( |
| 158 CommitEarlyOutReason::ABORTED_NOT_VISIBLE, begin_main_frame_start_time, | 159 CommitEarlyOutReason::ABORTED_NOT_VISIBLE, begin_main_frame_start_time, |
| 159 std::move(empty_swap_promises)); | 160 std::move(empty_swap_promises)); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 195 |
| 195 layer_tree_host_->WillCommit(); | 196 layer_tree_host_->WillCommit(); |
| 196 devtools_instrumentation::ScopedCommitTrace commit_task( | 197 devtools_instrumentation::ScopedCommitTrace commit_task( |
| 197 layer_tree_host_->GetId()); | 198 layer_tree_host_->GetId()); |
| 198 | 199 |
| 199 current_pipeline_stage_ = COMMIT_PIPELINE_STAGE; | 200 current_pipeline_stage_ = COMMIT_PIPELINE_STAGE; |
| 200 if (!updated && can_cancel_this_commit) { | 201 if (!updated && can_cancel_this_commit) { |
| 201 TRACE_EVENT_INSTANT0("cc", "EarlyOut_NoUpdates", TRACE_EVENT_SCOPE_THREAD); | 202 TRACE_EVENT_INSTANT0("cc", "EarlyOut_NoUpdates", TRACE_EVENT_SCOPE_THREAD); |
| 202 channel_main_->BeginMainFrameAbortedOnImpl( | 203 channel_main_->BeginMainFrameAbortedOnImpl( |
| 203 CommitEarlyOutReason::FINISHED_NO_UPDATES, begin_main_frame_start_time, | 204 CommitEarlyOutReason::FINISHED_NO_UPDATES, begin_main_frame_start_time, |
| 204 layer_tree_host_->TakeSwapPromises()); | 205 layer_tree_host_->GetSwapPromiseManager()->TakeSwapPromises()); |
| 205 | 206 |
| 206 // Although the commit is internally aborted, this is because it has been | 207 // Although the commit is internally aborted, this is because it has been |
| 207 // detected to be a no-op. From the perspective of an embedder, this commit | 208 // detected to be a no-op. From the perspective of an embedder, this commit |
| 208 // went through, and input should no longer be throttled, etc. | 209 // went through, and input should no longer be throttled, etc. |
| 209 current_pipeline_stage_ = NO_PIPELINE_STAGE; | 210 current_pipeline_stage_ = NO_PIPELINE_STAGE; |
| 210 layer_tree_host_->CommitComplete(); | 211 layer_tree_host_->CommitComplete(); |
| 211 layer_tree_host_->DidBeginMainFrame(); | 212 layer_tree_host_->DidBeginMainFrame(); |
| 212 return; | 213 return; |
| 213 } | 214 } |
| 214 | 215 |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 return false; | 422 return false; |
| 422 channel_main_->SetNeedsCommitOnImpl(); | 423 channel_main_->SetNeedsCommitOnImpl(); |
| 423 return true; | 424 return true; |
| 424 } | 425 } |
| 425 | 426 |
| 426 bool ProxyMain::IsMainThread() const { | 427 bool ProxyMain::IsMainThread() const { |
| 427 return task_runner_provider_->IsMainThread(); | 428 return task_runner_provider_->IsMainThread(); |
| 428 } | 429 } |
| 429 | 430 |
| 430 } // namespace cc | 431 } // namespace cc |
| OLD | NEW |