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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 layer_tree_host_impl_->top_controls_manager()->UpdateTopControlsState( | 139 layer_tree_host_impl_->top_controls_manager()->UpdateTopControlsState( |
140 constraints, current, animate); | 140 constraints, current, animate); |
141 } | 141 } |
142 | 142 |
143 void ProxyImpl::InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) { | 143 void ProxyImpl::InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) { |
144 TRACE_EVENT0("cc", "ProxyImpl::InitializeOutputSurfaceOnImplThread"); | 144 TRACE_EVENT0("cc", "ProxyImpl::InitializeOutputSurfaceOnImplThread"); |
145 DCHECK(IsImplThread()); | 145 DCHECK(IsImplThread()); |
146 | 146 |
147 LayerTreeHostImpl* host_impl = layer_tree_host_impl_.get(); | 147 LayerTreeHostImpl* host_impl = layer_tree_host_impl_.get(); |
148 bool success = host_impl->InitializeRenderer(output_surface); | 148 bool success = host_impl->InitializeRenderer(output_surface); |
149 RendererCapabilities capabilities; | 149 channel_impl_->DidInitializeOutputSurface(success); |
150 if (success) { | |
151 capabilities = | |
152 host_impl->GetRendererCapabilities().MainThreadCapabilities(); | |
153 } | |
154 | |
155 channel_impl_->DidInitializeOutputSurface(success, capabilities); | |
156 | |
157 if (success) | 150 if (success) |
158 scheduler_->DidCreateAndInitializeOutputSurface(); | 151 scheduler_->DidCreateAndInitializeOutputSurface(); |
159 } | 152 } |
160 | 153 |
161 void ProxyImpl::MainThreadHasStoppedFlingingOnImpl() { | 154 void ProxyImpl::MainThreadHasStoppedFlingingOnImpl() { |
162 DCHECK(IsImplThread()); | 155 DCHECK(IsImplThread()); |
163 layer_tree_host_impl_->MainThreadHasStoppedFlinging(); | 156 layer_tree_host_impl_->MainThreadHasStoppedFlinging(); |
164 } | 157 } |
165 | 158 |
166 void ProxyImpl::SetInputThrottledUntilCommitOnImpl(bool is_throttled) { | 159 void ProxyImpl::SetInputThrottledUntilCommitOnImpl(bool is_throttled) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 layer_tree_host_impl_->ReadyToCommit(); | 263 layer_tree_host_impl_->ReadyToCommit(); |
271 | 264 |
272 commit_completion_event_ = completion; | 265 commit_completion_event_ = completion; |
273 commit_completion_waits_for_activation_ = hold_commit_for_activation; | 266 commit_completion_waits_for_activation_ = hold_commit_for_activation; |
274 | 267 |
275 DCHECK(!blocked_main_commit().layer_tree_host); | 268 DCHECK(!blocked_main_commit().layer_tree_host); |
276 blocked_main_commit().layer_tree_host = layer_tree_host; | 269 blocked_main_commit().layer_tree_host = layer_tree_host; |
277 scheduler_->NotifyReadyToCommit(); | 270 scheduler_->NotifyReadyToCommit(); |
278 } | 271 } |
279 | 272 |
280 void ProxyImpl::UpdateRendererCapabilitiesOnImplThread() { | |
281 DCHECK(IsImplThread()); | |
282 channel_impl_->SetRendererCapabilitiesMainCopy( | |
283 layer_tree_host_impl_->GetRendererCapabilities() | |
284 .MainThreadCapabilities()); | |
285 } | |
286 | |
287 void ProxyImpl::DidLoseOutputSurfaceOnImplThread() { | 273 void ProxyImpl::DidLoseOutputSurfaceOnImplThread() { |
288 TRACE_EVENT0("cc", "ProxyImpl::DidLoseOutputSurfaceOnImplThread"); | 274 TRACE_EVENT0("cc", "ProxyImpl::DidLoseOutputSurfaceOnImplThread"); |
289 DCHECK(IsImplThread()); | 275 DCHECK(IsImplThread()); |
290 channel_impl_->DidLoseOutputSurface(); | 276 channel_impl_->DidLoseOutputSurface(); |
291 scheduler_->DidLoseOutputSurface(); | 277 scheduler_->DidLoseOutputSurface(); |
292 } | 278 } |
293 | 279 |
294 void ProxyImpl::CommitVSyncParameters(base::TimeTicks timebase, | 280 void ProxyImpl::CommitVSyncParameters(base::TimeTicks timebase, |
295 base::TimeDelta interval) { | 281 base::TimeDelta interval) { |
296 DCHECK(IsImplThread()); | 282 DCHECK(IsImplThread()); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 bool ProxyImpl::IsMainThreadBlocked() const { | 645 bool ProxyImpl::IsMainThreadBlocked() const { |
660 return task_runner_provider_->IsMainThreadBlocked(); | 646 return task_runner_provider_->IsMainThreadBlocked(); |
661 } | 647 } |
662 | 648 |
663 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { | 649 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { |
664 DCHECK(IsMainThreadBlocked() && commit_completion_event_); | 650 DCHECK(IsMainThreadBlocked() && commit_completion_event_); |
665 return main_thread_blocked_commit_vars_unsafe_; | 651 return main_thread_blocked_commit_vars_unsafe_; |
666 } | 652 } |
667 | 653 |
668 } // namespace cc | 654 } // namespace cc |
OLD | NEW |