Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ |
| 6 #define CC_TREES_LAYER_TREE_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 // Tracing methods. | 128 // Tracing methods. |
| 129 // --------------------------------------------------------------------------- | 129 // --------------------------------------------------------------------------- |
| 130 void GetAllPrioritizedTilesForTracing( | 130 void GetAllPrioritizedTilesForTracing( |
| 131 std::vector<PrioritizedTile>* prioritized_tiles) const; | 131 std::vector<PrioritizedTile>* prioritized_tiles) const; |
| 132 void AsValueInto(base::trace_event::TracedValue* dict) const; | 132 void AsValueInto(base::trace_event::TracedValue* dict) const; |
| 133 | 133 |
| 134 // Other public methods | 134 // Other public methods |
| 135 // --------------------------------------------------------------------------- | 135 // --------------------------------------------------------------------------- |
| 136 LayerImpl* root_layer() const { return root_layer_; } | 136 LayerImpl* root_layer() const { return root_layer_; } |
| 137 void SetRootLayer(std::unique_ptr<LayerImpl>); | 137 void SetRootLayer(std::unique_ptr<LayerImpl>); |
| 138 void SetRootLayerFromLayerList(); | |
| 138 bool IsRootLayer(const LayerImpl* layer) const; | 139 bool IsRootLayer(const LayerImpl* layer) const; |
| 139 std::unique_ptr<OwnedLayerImplList> DetachLayers(); | 140 std::unique_ptr<OwnedLayerImplList> DetachLayers(); |
| 140 | 141 |
| 141 void SetPropertyTrees(PropertyTrees* property_trees); | 142 void SetPropertyTrees(PropertyTrees* property_trees); |
| 142 PropertyTrees* property_trees() { return &property_trees_; } | 143 PropertyTrees* property_trees() { return &property_trees_; } |
| 143 | 144 |
| 144 void UpdatePropertyTreesForBoundsDelta(); | 145 void UpdatePropertyTreesForBoundsDelta(); |
| 145 | 146 |
| 146 void PushPropertiesTo(LayerTreeImpl* tree_impl); | 147 void PushPropertiesTo(LayerTreeImpl* tree_impl); |
| 147 | 148 |
| 148 void MoveChangeTrackingToLayers(); | 149 void MoveChangeTrackingToLayers(); |
| 149 | 150 |
| 150 LayerListIterator<LayerImpl> begin() const; | 151 std::vector<LayerImpl*>::const_iterator begin() const; |
| 151 LayerListIterator<LayerImpl> end() const; | 152 std::vector<LayerImpl*>::const_iterator end() const; |
| 152 LayerListReverseIterator<LayerImpl> rbegin(); | 153 std::vector<LayerImpl*>::reverse_iterator rbegin(); |
| 153 LayerListReverseIterator<LayerImpl> rend(); | 154 std::vector<LayerImpl*>::reverse_iterator rend(); |
|
ajuma
2016/06/09 15:15:19
There's a LayerImplList type defined (as vector<La
jaydasika
2016/06/09 16:56:25
Done.
| |
| 154 | 155 |
| 155 struct CC_EXPORT ElementLayers { | 156 struct CC_EXPORT ElementLayers { |
| 156 // Transform and opacity mutations apply to this layer. | 157 // Transform and opacity mutations apply to this layer. |
| 157 LayerImpl* main = nullptr; | 158 LayerImpl* main = nullptr; |
| 158 // Scroll mutations apply to this layer. | 159 // Scroll mutations apply to this layer. |
| 159 LayerImpl* scroll = nullptr; | 160 LayerImpl* scroll = nullptr; |
| 160 }; | 161 }; |
| 161 | 162 |
| 162 void AddToElementMap(LayerImpl* layer); | 163 void AddToElementMap(LayerImpl* layer); |
| 163 void RemoveFromElementMap(LayerImpl* layer); | 164 void RemoveFromElementMap(LayerImpl* layer); |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 467 return event_listener_properties_[static_cast<size_t>(event_class)]; | 468 return event_listener_properties_[static_cast<size_t>(event_class)]; |
| 468 } | 469 } |
| 469 void set_event_listener_properties(EventListenerClass event_class, | 470 void set_event_listener_properties(EventListenerClass event_class, |
| 470 EventListenerProperties event_properties) { | 471 EventListenerProperties event_properties) { |
| 471 event_listener_properties_[static_cast<size_t>(event_class)] = | 472 event_listener_properties_[static_cast<size_t>(event_class)] = |
| 472 event_properties; | 473 event_properties; |
| 473 } | 474 } |
| 474 | 475 |
| 475 void ResetAllChangeTracking(); | 476 void ResetAllChangeTracking(); |
| 476 | 477 |
| 478 void AddToLayerList(LayerImpl* layer); | |
| 479 | |
| 480 void ClearLayerList(); | |
| 481 | |
| 482 void BuildLayerListForTesting(); | |
| 483 | |
| 477 protected: | 484 protected: |
| 478 explicit LayerTreeImpl( | 485 explicit LayerTreeImpl( |
| 479 LayerTreeHostImpl* layer_tree_host_impl, | 486 LayerTreeHostImpl* layer_tree_host_impl, |
| 480 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, | 487 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, |
| 481 scoped_refptr<SyncedTopControls> top_controls_shown_ratio, | 488 scoped_refptr<SyncedTopControls> top_controls_shown_ratio, |
| 482 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll); | 489 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll); |
| 483 float ClampPageScaleFactorToLimits(float page_scale_factor) const; | 490 float ClampPageScaleFactorToLimits(float page_scale_factor) const; |
| 484 void PushPageScaleFactorAndLimits(const float* page_scale_factor, | 491 void PushPageScaleFactorAndLimits(const float* page_scale_factor, |
| 485 float min_page_scale_factor, | 492 float min_page_scale_factor, |
| 486 float max_page_scale_factor); | 493 float max_page_scale_factor); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 572 bool top_controls_shrink_blink_size_; | 579 bool top_controls_shrink_blink_size_; |
| 573 float top_controls_height_; | 580 float top_controls_height_; |
| 574 | 581 |
| 575 // The amount that the top controls are shown from 0 (hidden) to 1 (fully | 582 // The amount that the top controls are shown from 0 (hidden) to 1 (fully |
| 576 // shown). | 583 // shown). |
| 577 scoped_refptr<SyncedTopControls> top_controls_shown_ratio_; | 584 scoped_refptr<SyncedTopControls> top_controls_shown_ratio_; |
| 578 | 585 |
| 579 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 586 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
| 580 | 587 |
| 581 private: | 588 private: |
| 582 void BuildLayerListForTesting(); | |
| 583 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 589 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
| 584 }; | 590 }; |
| 585 | 591 |
| 586 } // namespace cc | 592 } // namespace cc |
| 587 | 593 |
| 588 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 594 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
| OLD | NEW |