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_impl.h" | 5 #include "cc/trees/proxy_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 smoothness_priority_expiration_notifier_.Shutdown(); | 104 smoothness_priority_expiration_notifier_.Shutdown(); |
105 } | 105 } |
106 | 106 |
107 void ProxyImpl::SetThrottleFrameProductionOnImpl(bool throttle) { | 107 void ProxyImpl::SetThrottleFrameProductionOnImpl(bool throttle) { |
108 TRACE_EVENT1("cc", "ProxyImpl::SetThrottleFrameProductionOnImplThread", | 108 TRACE_EVENT1("cc", "ProxyImpl::SetThrottleFrameProductionOnImplThread", |
109 "throttle", throttle); | 109 "throttle", throttle); |
110 DCHECK(IsImplThread()); | 110 DCHECK(IsImplThread()); |
111 scheduler_->SetThrottleFrameProduction(throttle); | 111 scheduler_->SetThrottleFrameProduction(throttle); |
112 } | 112 } |
113 | 113 |
| 114 void ProxyImpl::InitializeMutatorOnImpl(LayerTreeMutator* mutator) { |
| 115 TRACE_EVENT0("cc,compositor-worker", "ProxyImpl::InitializeMutatorOnImpl"); |
| 116 DCHECK(IsImplThread()); |
| 117 layer_tree_host_impl_->SetLayerTreeMutator(mutator); |
| 118 } |
| 119 |
114 void ProxyImpl::UpdateTopControlsStateOnImpl(TopControlsState constraints, | 120 void ProxyImpl::UpdateTopControlsStateOnImpl(TopControlsState constraints, |
115 TopControlsState current, | 121 TopControlsState current, |
116 bool animate) { | 122 bool animate) { |
117 DCHECK(IsImplThread()); | 123 DCHECK(IsImplThread()); |
118 layer_tree_host_impl_->top_controls_manager()->UpdateTopControlsState( | 124 layer_tree_host_impl_->top_controls_manager()->UpdateTopControlsState( |
119 constraints, current, animate); | 125 constraints, current, animate); |
120 } | 126 } |
121 | 127 |
122 void ProxyImpl::InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) { | 128 void ProxyImpl::InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) { |
123 TRACE_EVENT0("cc", "ProxyImpl::InitializeOutputSurfaceOnImplThread"); | 129 TRACE_EVENT0("cc", "ProxyImpl::InitializeOutputSurfaceOnImplThread"); |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 DCHECK(IsImplThread()); | 500 DCHECK(IsImplThread()); |
495 unsigned int begin_frame_id = nextBeginFrameId++; | 501 unsigned int begin_frame_id = nextBeginFrameId++; |
496 benchmark_instrumentation::ScopedBeginFrameTask begin_frame_task( | 502 benchmark_instrumentation::ScopedBeginFrameTask begin_frame_task( |
497 benchmark_instrumentation::kSendBeginFrame, begin_frame_id); | 503 benchmark_instrumentation::kSendBeginFrame, begin_frame_id); |
498 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state( | 504 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state( |
499 new BeginMainFrameAndCommitState); | 505 new BeginMainFrameAndCommitState); |
500 begin_main_frame_state->begin_frame_id = begin_frame_id; | 506 begin_main_frame_state->begin_frame_id = begin_frame_id; |
501 begin_main_frame_state->begin_frame_args = args; | 507 begin_main_frame_state->begin_frame_args = args; |
502 begin_main_frame_state->scroll_info = | 508 begin_main_frame_state->scroll_info = |
503 layer_tree_host_impl_->ProcessScrollDeltas(); | 509 layer_tree_host_impl_->ProcessScrollDeltas(); |
| 510 if (LayerTreeMutator* mutator = layer_tree_host_impl_->mutator()) |
| 511 begin_main_frame_state->mutations = mutator->TakeMutations(); |
| 512 |
504 begin_main_frame_state->memory_allocation_limit_bytes = | 513 begin_main_frame_state->memory_allocation_limit_bytes = |
505 layer_tree_host_impl_->memory_allocation_limit_bytes(); | 514 layer_tree_host_impl_->memory_allocation_limit_bytes(); |
506 begin_main_frame_state->evicted_ui_resources = | 515 begin_main_frame_state->evicted_ui_resources = |
507 layer_tree_host_impl_->EvictedUIResourcesExist(); | 516 layer_tree_host_impl_->EvictedUIResourcesExist(); |
508 // TODO(vmpstr): This needs to be fixed if | 517 // TODO(vmpstr): This needs to be fixed if |
509 // main_frame_before_activation_enabled is set, since we might run this code | 518 // main_frame_before_activation_enabled is set, since we might run this code |
510 // twice before recording a duration. crbug.com/469824 | 519 // twice before recording a duration. crbug.com/469824 |
511 last_begin_main_frame_args_ = begin_main_frame_state->begin_frame_args; | 520 last_begin_main_frame_args_ = begin_main_frame_state->begin_frame_args; |
512 channel_impl_->BeginMainFrame(std::move(begin_main_frame_state)); | 521 channel_impl_->BeginMainFrame(std::move(begin_main_frame_state)); |
513 devtools_instrumentation::DidRequestMainThreadFrame(layer_tree_host_id_); | 522 devtools_instrumentation::DidRequestMainThreadFrame(layer_tree_host_id_); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 bool ProxyImpl::IsMainThreadBlocked() const { | 680 bool ProxyImpl::IsMainThreadBlocked() const { |
672 return task_runner_provider_->IsMainThreadBlocked(); | 681 return task_runner_provider_->IsMainThreadBlocked(); |
673 } | 682 } |
674 | 683 |
675 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { | 684 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { |
676 DCHECK(IsMainThreadBlocked() && commit_completion_event_); | 685 DCHECK(IsMainThreadBlocked() && commit_completion_event_); |
677 return main_thread_blocked_commit_vars_unsafe_; | 686 return main_thread_blocked_commit_vars_unsafe_; |
678 } | 687 } |
679 | 688 |
680 } // namespace cc | 689 } // namespace cc |
OLD | NEW |