Chromium Code Reviews| 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/animation/animation_host.h" | 9 #include "cc/animation/animation_host.h" |
| 10 #include "cc/input/page_scale_animation.h" | 10 #include "cc/input/page_scale_animation.h" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 | 336 |
| 337 const LayerTreeSettings& LayerTree::GetSettings() const { | 337 const LayerTreeSettings& LayerTree::GetSettings() const { |
| 338 return layer_tree_host_->GetSettings(); | 338 return layer_tree_host_->GetSettings(); |
| 339 } | 339 } |
| 340 | 340 |
| 341 void LayerTree::SetPropertyTreesNeedRebuild() { | 341 void LayerTree::SetPropertyTreesNeedRebuild() { |
| 342 property_trees_.needs_rebuild = true; | 342 property_trees_.needs_rebuild = true; |
| 343 layer_tree_host_->SetNeedsUpdateLayers(); | 343 layer_tree_host_->SetNeedsUpdateLayers(); |
| 344 } | 344 } |
| 345 | 345 |
| 346 void LayerTree::PushPropertiesTo(LayerTreeImpl* tree_impl) { | 346 void LayerTree::PushPropertiesTo(LayerTreeImpl* tree_impl, |
| 347 float unapplied_page_scale_delta) { | |
| 347 tree_impl->set_needs_full_tree_sync(needs_full_tree_sync_); | 348 tree_impl->set_needs_full_tree_sync(needs_full_tree_sync_); |
| 348 needs_full_tree_sync_ = false; | 349 needs_full_tree_sync_ = false; |
| 349 | 350 |
| 350 if (hud_layer_.get()) { | 351 if (hud_layer_.get()) { |
| 351 LayerImpl* hud_impl = tree_impl->LayerById(hud_layer_->id()); | 352 LayerImpl* hud_impl = tree_impl->LayerById(hud_layer_->id()); |
| 352 tree_impl->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>(hud_impl)); | 353 tree_impl->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>(hud_impl)); |
| 353 } else { | 354 } else { |
| 354 tree_impl->set_hud_layer(nullptr); | 355 tree_impl->set_hud_layer(nullptr); |
| 355 } | 356 } |
| 356 | 357 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 393 if (inputs_.root_layer && property_trees_changed_on_active_tree) { | 394 if (inputs_.root_layer && property_trees_changed_on_active_tree) { |
| 394 if (property_trees_.sequence_number == | 395 if (property_trees_.sequence_number == |
| 395 tree_impl->property_trees()->sequence_number) | 396 tree_impl->property_trees()->sequence_number) |
| 396 tree_impl->property_trees()->PushChangeTrackingTo(&property_trees_); | 397 tree_impl->property_trees()->PushChangeTrackingTo(&property_trees_); |
| 397 else | 398 else |
| 398 tree_impl->MoveChangeTrackingToLayers(); | 399 tree_impl->MoveChangeTrackingToLayers(); |
| 399 } | 400 } |
| 400 // Setting property trees must happen before pushing the page scale. | 401 // Setting property trees must happen before pushing the page scale. |
| 401 tree_impl->SetPropertyTrees(&property_trees_); | 402 tree_impl->SetPropertyTrees(&property_trees_); |
| 402 | 403 |
| 403 tree_impl->PushPageScaleFromMainThread(inputs_.page_scale_factor, | 404 tree_impl->PushPageScaleFromMainThread( |
| 404 inputs_.min_page_scale_factor, | 405 inputs_.page_scale_factor * unapplied_page_scale_delta, |
|
aelias_OOO_until_Jul13
2016/10/28 03:40:20
Hmm, this resembles the approach I suggested for s
Khushal
2016/10/31 21:02:01
I did a little bit more digging, and finally lande
| |
| 405 inputs_.max_page_scale_factor); | 406 inputs_.min_page_scale_factor, inputs_.max_page_scale_factor); |
| 406 | 407 |
| 407 tree_impl->set_top_controls_shrink_blink_size( | 408 tree_impl->set_top_controls_shrink_blink_size( |
| 408 inputs_.top_controls_shrink_blink_size); | 409 inputs_.top_controls_shrink_blink_size); |
| 409 tree_impl->set_top_controls_height(inputs_.top_controls_height); | 410 tree_impl->set_top_controls_height(inputs_.top_controls_height); |
| 410 tree_impl->set_bottom_controls_height(inputs_.bottom_controls_height); | 411 tree_impl->set_bottom_controls_height(inputs_.bottom_controls_height); |
| 411 tree_impl->PushTopControlsFromMainThread(inputs_.top_controls_shown_ratio); | 412 tree_impl->PushTopControlsFromMainThread(inputs_.top_controls_shown_ratio); |
| 412 tree_impl->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); | 413 tree_impl->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); |
| 413 if (tree_impl->IsActiveTree()) | 414 if (tree_impl->IsActiveTree()) |
| 414 tree_impl->elastic_overscroll()->PushPendingToActive(); | 415 tree_impl->elastic_overscroll()->PushPendingToActive(); |
| 415 | 416 |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 691 LayerListReverseIterator<Layer> LayerTree::rend() { | 692 LayerListReverseIterator<Layer> LayerTree::rend() { |
| 692 return LayerListReverseIterator<Layer>(nullptr); | 693 return LayerListReverseIterator<Layer>(nullptr); |
| 693 } | 694 } |
| 694 | 695 |
| 695 void LayerTree::SetNeedsDisplayOnAllLayers() { | 696 void LayerTree::SetNeedsDisplayOnAllLayers() { |
| 696 for (auto* layer : *this) | 697 for (auto* layer : *this) |
| 697 layer->SetNeedsDisplay(); | 698 layer->SetNeedsDisplay(); |
| 698 } | 699 } |
| 699 | 700 |
| 700 } // namespace cc | 701 } // namespace cc |
| OLD | NEW |