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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 336 |
337 sync_tree->set_top_controls_shrink_blink_size( | 337 sync_tree->set_top_controls_shrink_blink_size( |
338 top_controls_shrink_blink_size_); | 338 top_controls_shrink_blink_size_); |
339 sync_tree->set_top_controls_height(top_controls_height_); | 339 sync_tree->set_top_controls_height(top_controls_height_); |
340 sync_tree->PushTopControlsFromMainThread(top_controls_shown_ratio_); | 340 sync_tree->PushTopControlsFromMainThread(top_controls_shown_ratio_); |
341 | 341 |
342 host_impl->SetUseGpuRasterization(UseGpuRasterization()); | 342 host_impl->SetUseGpuRasterization(UseGpuRasterization()); |
343 host_impl->set_gpu_rasterization_status(GetGpuRasterizationStatus()); | 343 host_impl->set_gpu_rasterization_status(GetGpuRasterizationStatus()); |
344 RecordGpuRasterizationHistogram(); | 344 RecordGpuRasterizationHistogram(); |
345 | 345 |
| 346 // When we are using GPU rasterization, tile size is based on the viewport |
| 347 // width. We could have layers that change in size, but are not invalidated |
| 348 // because no layout is required. When this happens, we need to notify the |
| 349 // layers that they require a PushProperties to resize the tiles correctly. |
| 350 if (root_layer() && |
| 351 device_viewport_size_ != host_impl->device_viewport_size() && |
| 352 UseGpuRasterization()) { |
| 353 LayerTreeHostCommon::CallFunctionForSubtree(root_layer(), [](Layer* layer) { |
| 354 layer->OnDeviceViewportSizeChanged(); |
| 355 }); |
| 356 } |
| 357 |
346 host_impl->SetViewportSize(device_viewport_size_); | 358 host_impl->SetViewportSize(device_viewport_size_); |
347 host_impl->SetDeviceScaleFactor(device_scale_factor_); | 359 host_impl->SetDeviceScaleFactor(device_scale_factor_); |
348 host_impl->SetDebugState(debug_state_); | 360 host_impl->SetDebugState(debug_state_); |
349 if (pending_page_scale_animation_) { | 361 if (pending_page_scale_animation_) { |
350 sync_tree->SetPendingPageScaleAnimation( | 362 sync_tree->SetPendingPageScaleAnimation( |
351 pending_page_scale_animation_.Pass()); | 363 pending_page_scale_animation_.Pass()); |
352 } | 364 } |
353 | 365 |
354 if (!ui_resource_request_queue_.empty()) { | 366 if (!ui_resource_request_queue_.empty()) { |
355 sync_tree->set_ui_resource_request_queue(ui_resource_request_queue_); | 367 sync_tree->set_ui_resource_request_queue(ui_resource_request_queue_); |
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 bool children_need_begin_frames) const { | 1289 bool children_need_begin_frames) const { |
1278 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); | 1290 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); |
1279 } | 1291 } |
1280 | 1292 |
1281 void LayerTreeHost::SendBeginFramesToChildren( | 1293 void LayerTreeHost::SendBeginFramesToChildren( |
1282 const BeginFrameArgs& args) const { | 1294 const BeginFrameArgs& args) const { |
1283 client_->SendBeginFramesToChildren(args); | 1295 client_->SendBeginFramesToChildren(args); |
1284 } | 1296 } |
1285 | 1297 |
1286 } // namespace cc | 1298 } // namespace cc |
OLD | NEW |