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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST, | 168 CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST, |
169 begin_main_frame_start_time); | 169 begin_main_frame_start_time); |
170 return; | 170 return; |
171 } | 171 } |
172 | 172 |
173 current_pipeline_stage_ = ANIMATE_PIPELINE_STAGE; | 173 current_pipeline_stage_ = ANIMATE_PIPELINE_STAGE; |
174 | 174 |
175 layer_tree_host_->ApplyScrollAndScale( | 175 layer_tree_host_->ApplyScrollAndScale( |
176 begin_main_frame_state->scroll_info.get()); | 176 begin_main_frame_state->scroll_info.get()); |
177 | 177 |
| 178 layer_tree_host_->ApplyMutations( |
| 179 begin_main_frame_state->mutations.get()); |
| 180 |
178 layer_tree_host_->WillBeginMainFrame(); | 181 layer_tree_host_->WillBeginMainFrame(); |
179 | 182 |
180 layer_tree_host_->BeginMainFrame(begin_main_frame_state->begin_frame_args); | 183 layer_tree_host_->BeginMainFrame(begin_main_frame_state->begin_frame_args); |
181 layer_tree_host_->AnimateLayers( | 184 layer_tree_host_->AnimateLayers( |
182 begin_main_frame_state->begin_frame_args.frame_time); | 185 begin_main_frame_state->begin_frame_args.frame_time); |
183 | 186 |
184 // Recreate all UI resources if there were evicted UI resources when the impl | 187 // Recreate all UI resources if there were evicted UI resources when the impl |
185 // thread initiated the commit. | 188 // thread initiated the commit. |
186 if (begin_main_frame_state->evicted_ui_resources) | 189 if (begin_main_frame_state->evicted_ui_resources) |
187 layer_tree_host_->RecreateUIResources(); | 190 layer_tree_host_->RecreateUIResources(); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 TRACE_EVENT0("cc", "ProxyMain::Stop"); | 397 TRACE_EVENT0("cc", "ProxyMain::Stop"); |
395 DCHECK(IsMainThread()); | 398 DCHECK(IsMainThread()); |
396 DCHECK(started_); | 399 DCHECK(started_); |
397 | 400 |
398 channel_main_->SynchronouslyCloseImpl(); | 401 channel_main_->SynchronouslyCloseImpl(); |
399 | 402 |
400 layer_tree_host_ = nullptr; | 403 layer_tree_host_ = nullptr; |
401 started_ = false; | 404 started_ = false; |
402 } | 405 } |
403 | 406 |
| 407 void ProxyMain::SetMutator(LayerTreeMutator* mutator) { |
| 408 TRACE_EVENT0("compositor-worker", "ThreadProxy::SetMutator"); |
| 409 channel_main_->InitializeMutatorOnImpl(mutator); |
| 410 } |
| 411 |
404 bool ProxyMain::SupportsImplScrolling() const { | 412 bool ProxyMain::SupportsImplScrolling() const { |
405 return true; | 413 return true; |
406 } | 414 } |
407 | 415 |
408 bool ProxyMain::MainFrameWillHappenForTesting() { | 416 bool ProxyMain::MainFrameWillHappenForTesting() { |
409 DCHECK(IsMainThread()); | 417 DCHECK(IsMainThread()); |
410 bool main_frame_will_happen = false; | 418 bool main_frame_will_happen = false; |
411 { | 419 { |
412 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); | 420 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); |
413 CompletionEvent completion; | 421 CompletionEvent completion; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 return false; | 462 return false; |
455 channel_main_->SetNeedsCommitOnImpl(); | 463 channel_main_->SetNeedsCommitOnImpl(); |
456 return true; | 464 return true; |
457 } | 465 } |
458 | 466 |
459 bool ProxyMain::IsMainThread() const { | 467 bool ProxyMain::IsMainThread() const { |
460 return task_runner_provider_->IsMainThread(); | 468 return task_runner_provider_->IsMainThread(); |
461 } | 469 } |
462 | 470 |
463 } // namespace cc | 471 } // namespace cc |
OLD | NEW |