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 if (settings_.calculate_top_controls_position && | 451 top_controls_manager_weak_ptr_ = |
452 host_impl->top_controls_manager()) { | 452 host_impl->top_controls_manager()->AsWeakPtr(); |
453 top_controls_manager_weak_ptr_ = | |
454 host_impl->top_controls_manager()->AsWeakPtr(); | |
455 } | |
456 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); | 453 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); |
457 return host_impl.Pass(); | 454 return host_impl.Pass(); |
458 } | 455 } |
459 | 456 |
460 void LayerTreeHost::DidLoseOutputSurface() { | 457 void LayerTreeHost::DidLoseOutputSurface() { |
461 TRACE_EVENT0("cc", "LayerTreeHost::DidLoseOutputSurface"); | 458 TRACE_EVENT0("cc", "LayerTreeHost::DidLoseOutputSurface"); |
462 DCHECK(proxy_->IsMainThread()); | 459 DCHECK(proxy_->IsMainThread()); |
463 | 460 |
464 if (output_surface_lost_) | 461 if (output_surface_lost_) |
465 return; | 462 return; |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 if (device_scale_factor == device_scale_factor_) | 1121 if (device_scale_factor == device_scale_factor_) |
1125 return; | 1122 return; |
1126 device_scale_factor_ = device_scale_factor; | 1123 device_scale_factor_ = device_scale_factor; |
1127 | 1124 |
1128 SetNeedsCommit(); | 1125 SetNeedsCommit(); |
1129 } | 1126 } |
1130 | 1127 |
1131 void LayerTreeHost::UpdateTopControlsState(TopControlsState constraints, | 1128 void LayerTreeHost::UpdateTopControlsState(TopControlsState constraints, |
1132 TopControlsState current, | 1129 TopControlsState current, |
1133 bool animate) { | 1130 bool animate) { |
1134 if (!settings_.calculate_top_controls_position) | |
1135 return; | |
1136 | |
1137 // Top controls are only used in threaded mode. | 1131 // Top controls are only used in threaded mode. |
1138 proxy_->ImplThreadTaskRunner()->PostTask( | 1132 proxy_->ImplThreadTaskRunner()->PostTask( |
1139 FROM_HERE, | 1133 FROM_HERE, |
1140 base::Bind(&TopControlsManager::UpdateTopControlsState, | 1134 base::Bind(&TopControlsManager::UpdateTopControlsState, |
1141 top_controls_manager_weak_ptr_, | 1135 top_controls_manager_weak_ptr_, |
1142 constraints, | 1136 constraints, |
1143 current, | 1137 current, |
1144 animate)); | 1138 animate)); |
1145 } | 1139 } |
1146 | 1140 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 bool children_need_begin_frames) const { | 1277 bool children_need_begin_frames) const { |
1284 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); | 1278 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); |
1285 } | 1279 } |
1286 | 1280 |
1287 void LayerTreeHost::SendBeginFramesToChildren( | 1281 void LayerTreeHost::SendBeginFramesToChildren( |
1288 const BeginFrameArgs& args) const { | 1282 const BeginFrameArgs& args) const { |
1289 client_->SendBeginFramesToChildren(args); | 1283 client_->SendBeginFramesToChildren(args); |
1290 } | 1284 } |
1291 | 1285 |
1292 } // namespace cc | 1286 } // namespace cc |
OLD | NEW |