| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 begin_main_frame_start_time, | 253 begin_main_frame_start_time, |
| 254 hold_commit_for_activation); | 254 hold_commit_for_activation); |
| 255 completion.Wait(); | 255 completion.Wait(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 current_pipeline_stage_ = NO_PIPELINE_STAGE; | 258 current_pipeline_stage_ = NO_PIPELINE_STAGE; |
| 259 layer_tree_host_->CommitComplete(); | 259 layer_tree_host_->CommitComplete(); |
| 260 layer_tree_host_->DidBeginMainFrame(); | 260 layer_tree_host_->DidBeginMainFrame(); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void ProxyMain::FinishAllRendering() { | |
| 264 DCHECK(IsMainThread()); | |
| 265 DCHECK(!defer_commits_); | |
| 266 | |
| 267 // Make sure all GL drawing is finished on the impl thread. | |
| 268 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); | |
| 269 CompletionEvent completion; | |
| 270 channel_main_->FinishAllRenderingOnImpl(&completion); | |
| 271 completion.Wait(); | |
| 272 } | |
| 273 | |
| 274 bool ProxyMain::IsStarted() const { | 263 bool ProxyMain::IsStarted() const { |
| 275 DCHECK(IsMainThread()); | 264 DCHECK(IsMainThread()); |
| 276 return started_; | 265 return started_; |
| 277 } | 266 } |
| 278 | 267 |
| 279 bool ProxyMain::CommitToActiveTree() const { | 268 bool ProxyMain::CommitToActiveTree() const { |
| 280 // With ProxyMain, we use a pending tree and activate it once it's ready to | 269 // With ProxyMain, we use a pending tree and activate it once it's ready to |
| 281 // draw to allow input to modify the active tree and draw during raster. | 270 // draw to allow input to modify the active tree and draw during raster. |
| 282 return false; | 271 return false; |
| 283 } | 272 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 return false; | 448 return false; |
| 460 channel_main_->SetNeedsCommitOnImpl(); | 449 channel_main_->SetNeedsCommitOnImpl(); |
| 461 return true; | 450 return true; |
| 462 } | 451 } |
| 463 | 452 |
| 464 bool ProxyMain::IsMainThread() const { | 453 bool ProxyMain::IsMainThread() const { |
| 465 return task_runner_provider_->IsMainThread(); | 454 return task_runner_provider_->IsMainThread(); |
| 466 } | 455 } |
| 467 | 456 |
| 468 } // namespace cc | 457 } // namespace cc |
| OLD | NEW |