| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.h" | 5 #include "cc/trees/layer_tree.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "cc/input/page_scale_animation.h" | 9 #include "cc/input/page_scale_animation.h" |
| 10 #include "cc/layers/heads_up_display_layer.h" | 10 #include "cc/layers/heads_up_display_layer.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 315 |
| 316 const LayerTreeSettings& LayerTree::GetSettings() const { | 316 const LayerTreeSettings& LayerTree::GetSettings() const { |
| 317 return layer_tree_host_->GetSettings(); | 317 return layer_tree_host_->GetSettings(); |
| 318 } | 318 } |
| 319 | 319 |
| 320 void LayerTree::SetPropertyTreesNeedRebuild() { | 320 void LayerTree::SetPropertyTreesNeedRebuild() { |
| 321 property_trees_.needs_rebuild = true; | 321 property_trees_.needs_rebuild = true; |
| 322 layer_tree_host_->SetNeedsUpdateLayers(); | 322 layer_tree_host_->SetNeedsUpdateLayers(); |
| 323 } | 323 } |
| 324 | 324 |
| 325 void LayerTree::PushPropertiesTo(LayerTreeImpl* tree_impl, | 325 void LayerTree::PushPropertiesTo(LayerTreeImpl* tree_impl) { |
| 326 float unapplied_page_scale_delta) { | |
| 327 tree_impl->set_needs_full_tree_sync(needs_full_tree_sync_); | 326 tree_impl->set_needs_full_tree_sync(needs_full_tree_sync_); |
| 328 needs_full_tree_sync_ = false; | 327 needs_full_tree_sync_ = false; |
| 329 | 328 |
| 330 if (hud_layer_.get()) { | 329 if (hud_layer_.get()) { |
| 331 LayerImpl* hud_impl = tree_impl->LayerById(hud_layer_->id()); | 330 LayerImpl* hud_impl = tree_impl->LayerById(hud_layer_->id()); |
| 332 tree_impl->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>(hud_impl)); | 331 tree_impl->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>(hud_impl)); |
| 333 } else { | 332 } else { |
| 334 tree_impl->set_hud_layer(nullptr); | 333 tree_impl->set_hud_layer(nullptr); |
| 335 } | 334 } |
| 336 | 335 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 if (inputs_.root_layer && property_trees_changed_on_active_tree) { | 372 if (inputs_.root_layer && property_trees_changed_on_active_tree) { |
| 374 if (property_trees_.sequence_number == | 373 if (property_trees_.sequence_number == |
| 375 tree_impl->property_trees()->sequence_number) | 374 tree_impl->property_trees()->sequence_number) |
| 376 tree_impl->property_trees()->PushChangeTrackingTo(&property_trees_); | 375 tree_impl->property_trees()->PushChangeTrackingTo(&property_trees_); |
| 377 else | 376 else |
| 378 tree_impl->MoveChangeTrackingToLayers(); | 377 tree_impl->MoveChangeTrackingToLayers(); |
| 379 } | 378 } |
| 380 // Setting property trees must happen before pushing the page scale. | 379 // Setting property trees must happen before pushing the page scale. |
| 381 tree_impl->SetPropertyTrees(&property_trees_); | 380 tree_impl->SetPropertyTrees(&property_trees_); |
| 382 | 381 |
| 383 tree_impl->PushPageScaleFromMainThread( | 382 tree_impl->PushPageScaleFromMainThread(inputs_.page_scale_factor, |
| 384 inputs_.page_scale_factor * unapplied_page_scale_delta, | 383 inputs_.min_page_scale_factor, |
| 385 inputs_.min_page_scale_factor, inputs_.max_page_scale_factor); | 384 inputs_.max_page_scale_factor); |
| 386 | 385 |
| 387 tree_impl->set_browser_controls_shrink_blink_size( | 386 tree_impl->set_browser_controls_shrink_blink_size( |
| 388 inputs_.browser_controls_shrink_blink_size); | 387 inputs_.browser_controls_shrink_blink_size); |
| 389 tree_impl->set_top_controls_height(inputs_.top_controls_height); | 388 tree_impl->set_top_controls_height(inputs_.top_controls_height); |
| 390 tree_impl->set_bottom_controls_height(inputs_.bottom_controls_height); | 389 tree_impl->set_bottom_controls_height(inputs_.bottom_controls_height); |
| 391 tree_impl->PushBrowserControlsFromMainThread( | 390 tree_impl->PushBrowserControlsFromMainThread( |
| 392 inputs_.top_controls_shown_ratio); | 391 inputs_.top_controls_shown_ratio); |
| 393 tree_impl->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); | 392 tree_impl->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); |
| 394 if (tree_impl->IsActiveTree()) | 393 if (tree_impl->IsActiveTree()) |
| 395 tree_impl->elastic_overscroll()->PushPendingToActive(); | 394 tree_impl->elastic_overscroll()->PushPendingToActive(); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 LayerListReverseIterator<Layer> LayerTree::rend() { | 528 LayerListReverseIterator<Layer> LayerTree::rend() { |
| 530 return LayerListReverseIterator<Layer>(nullptr); | 529 return LayerListReverseIterator<Layer>(nullptr); |
| 531 } | 530 } |
| 532 | 531 |
| 533 void LayerTree::SetNeedsDisplayOnAllLayers() { | 532 void LayerTree::SetNeedsDisplayOnAllLayers() { |
| 534 for (auto* layer : *this) | 533 for (auto* layer : *this) |
| 535 layer->SetNeedsDisplay(); | 534 layer->SetNeedsDisplay(); |
| 536 } | 535 } |
| 537 | 536 |
| 538 } // namespace cc | 537 } // namespace cc |
| OLD | NEW |