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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
534 else | 534 else |
535 target_tree->ResetViewportSizeInvalid(); | 535 target_tree->ResetViewportSizeInvalid(); |
536 | 536 |
537 if (hud_layer()) | 537 if (hud_layer()) |
538 target_tree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>( | 538 target_tree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>( |
539 target_tree->LayerById(hud_layer()->id()))); | 539 target_tree->LayerById(hud_layer()->id()))); |
540 else | 540 else |
541 target_tree->set_hud_layer(NULL); | 541 target_tree->set_hud_layer(NULL); |
542 | 542 |
543 target_tree->has_ever_been_drawn_ = false; | 543 target_tree->has_ever_been_drawn_ = false; |
544 | |
545 // Note: this needs to happen after SetPropertyTrees. | |
546 target_tree->ShowScrollbars(); | |
bokan
2017/03/27 16:25:13
I think this relies on there always being a pendin
skobes
2017/03/27 19:00:31
Based on LTHI::CommitToActiveTree it looks like we
| |
547 } | |
548 | |
549 void LayerTreeImpl::ShowScrollbars() { | |
550 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [this]( | |
551 LayerImpl* layer) { | |
552 if (!layer->needs_show_scrollbars()) | |
553 return; | |
554 ScrollbarAnimationController* controller = | |
555 layer_tree_host_impl_->ScrollbarAnimationControllerForId(layer->id()); | |
556 if (controller) { | |
557 controller->DidRequestShowFromMainThread(); | |
558 layer->set_needs_show_scrollbars(false); | |
559 } | |
560 }); | |
544 } | 561 } |
545 | 562 |
546 void LayerTreeImpl::MoveChangeTrackingToLayers() { | 563 void LayerTreeImpl::MoveChangeTrackingToLayers() { |
547 // We need to update the change tracking on property trees before we move it | 564 // We need to update the change tracking on property trees before we move it |
548 // onto the layers. | 565 // onto the layers. |
549 property_trees_.UpdateChangeTracking(); | 566 property_trees_.UpdateChangeTracking(); |
550 for (auto* layer : *this) { | 567 for (auto* layer : *this) { |
551 if (layer->LayerPropertyChanged()) | 568 if (layer->LayerPropertyChanged()) |
552 layer->NoteLayerPropertyChanged(); | 569 layer->NoteLayerPropertyChanged(); |
553 } | 570 } |
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2157 | 2174 |
2158 void LayerTreeImpl::ResetAllChangeTracking() { | 2175 void LayerTreeImpl::ResetAllChangeTracking() { |
2159 layers_that_should_push_properties_.clear(); | 2176 layers_that_should_push_properties_.clear(); |
2160 // Iterate over all layers, including masks. | 2177 // Iterate over all layers, including masks. |
2161 for (auto& layer : *layers_) | 2178 for (auto& layer : *layers_) |
2162 layer->ResetChangeTracking(); | 2179 layer->ResetChangeTracking(); |
2163 property_trees_.ResetAllChangeTracking(); | 2180 property_trees_.ResetAllChangeTracking(); |
2164 } | 2181 } |
2165 | 2182 |
2166 } // namespace cc | 2183 } // namespace cc |
OLD | NEW |