| 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 #ifndef CC_TREES_LAYER_TREE_H_ | 5 #ifndef CC_TREES_LAYER_TREE_H_ |
| 6 #define CC_TREES_LAYER_TREE_H_ | 6 #define CC_TREES_LAYER_TREE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <unordered_set> | 10 #include <unordered_set> |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 bool use_anchor, | 107 bool use_anchor, |
| 108 float scale, | 108 float scale, |
| 109 base::TimeDelta duration); | 109 base::TimeDelta duration); |
| 110 bool HasPendingPageScaleAnimation() const; | 110 bool HasPendingPageScaleAnimation() const; |
| 111 | 111 |
| 112 void SetDeviceScaleFactor(float device_scale_factor); | 112 void SetDeviceScaleFactor(float device_scale_factor); |
| 113 float device_scale_factor() const { return inputs_.device_scale_factor; } | 113 float device_scale_factor() const { return inputs_.device_scale_factor; } |
| 114 | 114 |
| 115 void SetPaintedDeviceScaleFactor(float painted_device_scale_factor); | 115 void SetPaintedDeviceScaleFactor(float painted_device_scale_factor); |
| 116 | 116 |
| 117 gfx::Vector2dF elastic_overscroll() const { return elastic_overscroll_; } | |
| 118 | |
| 119 // Used externally by blink for setting the PropertyTrees when | 117 // Used externally by blink for setting the PropertyTrees when |
| 120 // |settings_.use_layer_lists| is true. This is a SPV2 setting. | 118 // |settings_.use_layer_lists| is true. This is a SPV2 setting. |
| 121 PropertyTrees* property_trees() { return &property_trees_; } | 119 PropertyTrees* property_trees() { return &property_trees_; } |
| 122 | 120 |
| 123 bool in_paint_layer_contents() const { return in_paint_layer_contents_; } | 121 void SetNeedsDisplayOnAllLayers(); |
| 124 | 122 |
| 125 // Methods which should only be used internally in cc ------------------ | 123 // Methods which should only be used internally in cc ------------------ |
| 126 void RegisterLayer(Layer* layer); | 124 void RegisterLayer(Layer* layer); |
| 127 void UnregisterLayer(Layer* layer); | 125 void UnregisterLayer(Layer* layer); |
| 128 Layer* LayerById(int id) const; | 126 Layer* LayerById(int id) const; |
| 127 |
| 129 bool UpdateLayers(const LayerList& update_layer_list, | 128 bool UpdateLayers(const LayerList& update_layer_list, |
| 130 bool* content_is_suitable_for_gpu); | 129 bool* content_is_suitable_for_gpu); |
| 130 bool in_paint_layer_contents() const { return in_paint_layer_contents_; } |
| 131 | 131 |
| 132 void AddLayerShouldPushProperties(Layer* layer); | 132 void AddLayerShouldPushProperties(Layer* layer); |
| 133 void RemoveLayerShouldPushProperties(Layer* layer); | 133 void RemoveLayerShouldPushProperties(Layer* layer); |
| 134 std::unordered_set<Layer*>& LayersThatShouldPushProperties(); | 134 std::unordered_set<Layer*>& LayersThatShouldPushProperties(); |
| 135 bool LayerNeedsPushPropertiesForTesting(Layer* layer) const; | 135 bool LayerNeedsPushPropertiesForTesting(Layer* layer) const; |
| 136 | 136 |
| 137 virtual void SetNeedsMetaInfoRecomputation( | 137 virtual void SetNeedsMetaInfoRecomputation( |
| 138 bool needs_meta_info_recomputation); | 138 bool needs_meta_info_recomputation); |
| 139 bool needs_meta_info_recomputation() const { | 139 bool needs_meta_info_recomputation() const { |
| 140 return needs_meta_info_recomputation_; | 140 return needs_meta_info_recomputation_; |
| 141 } | 141 } |
| 142 | 142 |
| 143 void SetPageScaleFromImplSide(float page_scale); | 143 void SetPageScaleFromImplSide(float page_scale); |
| 144 void SetElasticOverscrollFromImplSide(gfx::Vector2dF elastic_overscroll); | 144 void SetElasticOverscrollFromImplSide(gfx::Vector2dF elastic_overscroll); |
| 145 gfx::Vector2dF elastic_overscroll() const { return elastic_overscroll_; } |
| 145 | 146 |
| 146 void UpdateHudLayer(bool show_hud_info); | 147 void UpdateHudLayer(bool show_hud_info); |
| 147 HeadsUpDisplayLayer* hud_layer() const { return hud_layer_.get(); } | 148 HeadsUpDisplayLayer* hud_layer() const { return hud_layer_.get(); } |
| 148 | 149 |
| 149 virtual void SetNeedsFullTreeSync(); | 150 virtual void SetNeedsFullTreeSync(); |
| 150 bool needs_full_tree_sync() const { return needs_full_tree_sync_; } | 151 bool needs_full_tree_sync() const { return needs_full_tree_sync_; } |
| 151 | 152 |
| 152 void SetNeedsCommit(); | 153 void SetNeedsCommit(); |
| 153 void SetPropertyTreesNeedRebuild(); | 154 void SetPropertyTreesNeedRebuild(); |
| 154 | 155 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 166 void UnregisterElement(ElementId element_id, | 167 void UnregisterElement(ElementId element_id, |
| 167 ElementListType list_type, | 168 ElementListType list_type, |
| 168 Layer* layer); | 169 Layer* layer); |
| 169 void SetElementIdsForTesting(); | 170 void SetElementIdsForTesting(); |
| 170 | 171 |
| 171 // Layer iterators. | 172 // Layer iterators. |
| 172 LayerListIterator<Layer> begin() const; | 173 LayerListIterator<Layer> begin() const; |
| 173 LayerListIterator<Layer> end() const; | 174 LayerListIterator<Layer> end() const; |
| 174 LayerListReverseIterator<Layer> rbegin(); | 175 LayerListReverseIterator<Layer> rbegin(); |
| 175 LayerListReverseIterator<Layer> rend(); | 176 LayerListReverseIterator<Layer> rend(); |
| 176 | |
| 177 void SetNeedsDisplayOnAllLayers(); | |
| 178 // --------------------------------------------------------------------- | 177 // --------------------------------------------------------------------- |
| 179 | 178 |
| 180 private: | 179 private: |
| 181 friend class LayerTreeHostSerializationTest; | 180 friend class LayerTreeHostSerializationTest; |
| 182 | 181 |
| 183 // MutatorHostClient implementation. | 182 // MutatorHostClient implementation. |
| 184 bool IsElementInList(ElementId element_id, | 183 bool IsElementInList(ElementId element_id, |
| 185 ElementListType list_type) const override; | 184 ElementListType list_type) const override; |
| 186 void SetMutatorsNeedCommit() override; | 185 void SetMutatorsNeedCommit() override; |
| 187 void SetMutatorsNeedRebuildPropertyTrees() override; | 186 void SetMutatorsNeedRebuildPropertyTrees() override; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 275 |
| 277 std::unique_ptr<AnimationHost> animation_host_; | 276 std::unique_ptr<AnimationHost> animation_host_; |
| 278 LayerTreeHost* layer_tree_host_; | 277 LayerTreeHost* layer_tree_host_; |
| 279 | 278 |
| 280 DISALLOW_COPY_AND_ASSIGN(LayerTree); | 279 DISALLOW_COPY_AND_ASSIGN(LayerTree); |
| 281 }; | 280 }; |
| 282 | 281 |
| 283 } // namespace cc | 282 } // namespace cc |
| 284 | 283 |
| 285 #endif // CC_TREES_LAYER_TREE_H_ | 284 #endif // CC_TREES_LAYER_TREE_H_ |
| OLD | NEW |