Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(646)

Side by Side Diff: cc/trees/proxy_main.cc

Issue 2323423002: cc: Add SwapPromiseManager and SurfaceSequenceGenerator. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; 138 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises;
139 channel_main_->BeginMainFrameAbortedOnImpl( 139 channel_main_->BeginMainFrameAbortedOnImpl(
140 CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT, 140 CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT,
141 begin_main_frame_start_time, std::move(empty_swap_promises)); 141 begin_main_frame_start_time, std::move(empty_swap_promises));
142 return; 142 return;
143 } 143 }
144 144
145 // If the commit finishes, LayerTreeHost will transfer its swap promises to 145 // If the commit finishes, LayerTreeHost will transfer its swap promises to
146 // LayerTreeImpl. The destructor of ScopedSwapPromiseChecker aborts the 146 // LayerTreeImpl. The destructor of ScopedSwapPromiseChecker aborts the
147 // remaining swap promises. 147 // remaining swap promises.
148 ScopedAbortRemainingSwapPromises swap_promise_checker(layer_tree_host_); 148 ScopedAbortRemainingSwapPromises swap_promise_checker(
149 layer_tree_host_->GetSwapPromiseManager());
149 150
150 final_pipeline_stage_ = max_requested_pipeline_stage_; 151 final_pipeline_stage_ = max_requested_pipeline_stage_;
151 max_requested_pipeline_stage_ = NO_PIPELINE_STAGE; 152 max_requested_pipeline_stage_ = NO_PIPELINE_STAGE;
152 153
153 if (!layer_tree_host_->IsVisible()) { 154 if (!layer_tree_host_->IsVisible()) {
154 TRACE_EVENT_INSTANT0("cc", "EarlyOut_NotVisible", TRACE_EVENT_SCOPE_THREAD); 155 TRACE_EVENT_INSTANT0("cc", "EarlyOut_NotVisible", TRACE_EVENT_SCOPE_THREAD);
155 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; 156 std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises;
156 channel_main_->BeginMainFrameAbortedOnImpl( 157 channel_main_->BeginMainFrameAbortedOnImpl(
157 CommitEarlyOutReason::ABORTED_NOT_VISIBLE, begin_main_frame_start_time, 158 CommitEarlyOutReason::ABORTED_NOT_VISIBLE, begin_main_frame_start_time,
158 std::move(empty_swap_promises)); 159 std::move(empty_swap_promises));
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 194
194 layer_tree_host_->WillCommit(); 195 layer_tree_host_->WillCommit();
195 devtools_instrumentation::ScopedCommitTrace commit_task( 196 devtools_instrumentation::ScopedCommitTrace commit_task(
196 layer_tree_host_->GetId()); 197 layer_tree_host_->GetId());
197 198
198 current_pipeline_stage_ = COMMIT_PIPELINE_STAGE; 199 current_pipeline_stage_ = COMMIT_PIPELINE_STAGE;
199 if (!updated && can_cancel_this_commit) { 200 if (!updated && can_cancel_this_commit) {
200 TRACE_EVENT_INSTANT0("cc", "EarlyOut_NoUpdates", TRACE_EVENT_SCOPE_THREAD); 201 TRACE_EVENT_INSTANT0("cc", "EarlyOut_NoUpdates", TRACE_EVENT_SCOPE_THREAD);
201 channel_main_->BeginMainFrameAbortedOnImpl( 202 channel_main_->BeginMainFrameAbortedOnImpl(
202 CommitEarlyOutReason::FINISHED_NO_UPDATES, begin_main_frame_start_time, 203 CommitEarlyOutReason::FINISHED_NO_UPDATES, begin_main_frame_start_time,
203 layer_tree_host_->TakeSwapPromises()); 204 layer_tree_host_->GetSwapPromiseManager()->TakeSwapPromises());
204 205
205 // Although the commit is internally aborted, this is because it has been 206 // Although the commit is internally aborted, this is because it has been
206 // detected to be a no-op. From the perspective of an embedder, this commit 207 // detected to be a no-op. From the perspective of an embedder, this commit
207 // went through, and input should no longer be throttled, etc. 208 // went through, and input should no longer be throttled, etc.
208 current_pipeline_stage_ = NO_PIPELINE_STAGE; 209 current_pipeline_stage_ = NO_PIPELINE_STAGE;
209 layer_tree_host_->CommitComplete(); 210 layer_tree_host_->CommitComplete();
210 layer_tree_host_->DidBeginMainFrame(); 211 layer_tree_host_->DidBeginMainFrame();
211 return; 212 return;
212 } 213 }
213 214
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698