| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <stack> | 8 #include <stack> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 LayerTreeHostImpl::Create(settings_, | 441 LayerTreeHostImpl::Create(settings_, |
| 442 client, | 442 client, |
| 443 proxy_.get(), | 443 proxy_.get(), |
| 444 rendering_stats_instrumentation_.get(), | 444 rendering_stats_instrumentation_.get(), |
| 445 shared_bitmap_manager_, | 445 shared_bitmap_manager_, |
| 446 gpu_memory_buffer_manager_, | 446 gpu_memory_buffer_manager_, |
| 447 id_); | 447 id_); |
| 448 host_impl->SetUseGpuRasterization(UseGpuRasterization()); | 448 host_impl->SetUseGpuRasterization(UseGpuRasterization()); |
| 449 shared_bitmap_manager_ = NULL; | 449 shared_bitmap_manager_ = NULL; |
| 450 gpu_memory_buffer_manager_ = NULL; | 450 gpu_memory_buffer_manager_ = NULL; |
| 451 top_controls_manager_weak_ptr_ = | 451 if (settings_.calculate_top_controls_position && |
| 452 host_impl->top_controls_manager()->AsWeakPtr(); | 452 host_impl->top_controls_manager()) { |
| 453 top_controls_manager_weak_ptr_ = |
| 454 host_impl->top_controls_manager()->AsWeakPtr(); |
| 455 } |
| 453 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); | 456 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); |
| 454 return host_impl.Pass(); | 457 return host_impl.Pass(); |
| 455 } | 458 } |
| 456 | 459 |
| 457 void LayerTreeHost::DidLoseOutputSurface() { | 460 void LayerTreeHost::DidLoseOutputSurface() { |
| 458 TRACE_EVENT0("cc", "LayerTreeHost::DidLoseOutputSurface"); | 461 TRACE_EVENT0("cc", "LayerTreeHost::DidLoseOutputSurface"); |
| 459 DCHECK(proxy_->IsMainThread()); | 462 DCHECK(proxy_->IsMainThread()); |
| 460 | 463 |
| 461 if (output_surface_lost_) | 464 if (output_surface_lost_) |
| 462 return; | 465 return; |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 if (device_scale_factor == device_scale_factor_) | 1151 if (device_scale_factor == device_scale_factor_) |
| 1149 return; | 1152 return; |
| 1150 device_scale_factor_ = device_scale_factor; | 1153 device_scale_factor_ = device_scale_factor; |
| 1151 | 1154 |
| 1152 SetNeedsCommit(); | 1155 SetNeedsCommit(); |
| 1153 } | 1156 } |
| 1154 | 1157 |
| 1155 void LayerTreeHost::UpdateTopControlsState(TopControlsState constraints, | 1158 void LayerTreeHost::UpdateTopControlsState(TopControlsState constraints, |
| 1156 TopControlsState current, | 1159 TopControlsState current, |
| 1157 bool animate) { | 1160 bool animate) { |
| 1161 if (!settings_.calculate_top_controls_position) |
| 1162 return; |
| 1163 |
| 1158 // Top controls are only used in threaded mode. | 1164 // Top controls are only used in threaded mode. |
| 1159 proxy_->ImplThreadTaskRunner()->PostTask( | 1165 proxy_->ImplThreadTaskRunner()->PostTask( |
| 1160 FROM_HERE, | 1166 FROM_HERE, |
| 1161 base::Bind(&TopControlsManager::UpdateTopControlsState, | 1167 base::Bind(&TopControlsManager::UpdateTopControlsState, |
| 1162 top_controls_manager_weak_ptr_, | 1168 top_controls_manager_weak_ptr_, |
| 1163 constraints, | 1169 constraints, |
| 1164 current, | 1170 current, |
| 1165 animate)); | 1171 animate)); |
| 1166 } | 1172 } |
| 1167 | 1173 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 bool children_need_begin_frames) const { | 1318 bool children_need_begin_frames) const { |
| 1313 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); | 1319 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); |
| 1314 } | 1320 } |
| 1315 | 1321 |
| 1316 void LayerTreeHost::SendBeginFramesToChildren( | 1322 void LayerTreeHost::SendBeginFramesToChildren( |
| 1317 const BeginFrameArgs& args) const { | 1323 const BeginFrameArgs& args) const { |
| 1318 client_->SendBeginFramesToChildren(args); | 1324 client_->SendBeginFramesToChildren(args); |
| 1319 } | 1325 } |
| 1320 | 1326 |
| 1321 } // namespace cc | 1327 } // namespace cc |
| OLD | NEW |