| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 163 |
| 164 struct CC_EXPORT ElementLayers { | 164 struct CC_EXPORT ElementLayers { |
| 165 // Transform and opacity mutations apply to this layer. | 165 // Transform and opacity mutations apply to this layer. |
| 166 LayerImpl* main = nullptr; | 166 LayerImpl* main = nullptr; |
| 167 // Scroll mutations apply to this layer. | 167 // Scroll mutations apply to this layer. |
| 168 LayerImpl* scroll = nullptr; | 168 LayerImpl* scroll = nullptr; |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 void AddToElementMap(LayerImpl* layer); | 171 void AddToElementMap(LayerImpl* layer); |
| 172 void RemoveFromElementMap(LayerImpl* layer); | 172 void RemoveFromElementMap(LayerImpl* layer); |
| 173 |
| 174 void AddToOpacityAnimationsMap(int id, float opacity); |
| 175 |
| 173 ElementLayers GetMutableLayers(uint64_t element_id); | 176 ElementLayers GetMutableLayers(uint64_t element_id); |
| 174 int source_frame_number() const { return source_frame_number_; } | 177 int source_frame_number() const { return source_frame_number_; } |
| 175 void set_source_frame_number(int frame_number) { | 178 void set_source_frame_number(int frame_number) { |
| 176 source_frame_number_ = frame_number; | 179 source_frame_number_ = frame_number; |
| 177 } | 180 } |
| 178 | 181 |
| 179 bool is_first_frame_after_commit() const { | 182 bool is_first_frame_after_commit() const { |
| 180 return source_frame_number_ != is_first_frame_after_commit_tracker_; | 183 return source_frame_number_ != is_first_frame_after_commit_tracker_; |
| 181 } | 184 } |
| 182 | 185 |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 530 |
| 528 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_; | 531 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_; |
| 529 | 532 |
| 530 std::unique_ptr<OwnedLayerImplList> layers_; | 533 std::unique_ptr<OwnedLayerImplList> layers_; |
| 531 LayerImplMap layer_id_map_; | 534 LayerImplMap layer_id_map_; |
| 532 // Set of layers that need to push properties. | 535 // Set of layers that need to push properties. |
| 533 std::unordered_set<LayerImpl*> layers_that_should_push_properties_; | 536 std::unordered_set<LayerImpl*> layers_that_should_push_properties_; |
| 534 | 537 |
| 535 std::unordered_map<uint64_t, ElementLayers> element_layers_map_; | 538 std::unordered_map<uint64_t, ElementLayers> element_layers_map_; |
| 536 | 539 |
| 540 std::unordered_map<int, float> opacity_animations_map_; |
| 541 |
| 537 // Maps from clip layer ids to scroll layer ids. Note that this only includes | 542 // Maps from clip layer ids to scroll layer ids. Note that this only includes |
| 538 // the subset of clip layers that act as scrolling containers. (This is | 543 // the subset of clip layers that act as scrolling containers. (This is |
| 539 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.) | 544 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.) |
| 540 std::unordered_map<int, int> clip_scroll_map_; | 545 std::unordered_map<int, int> clip_scroll_map_; |
| 541 | 546 |
| 542 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there | 547 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there |
| 543 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is | 548 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is |
| 544 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid | 549 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid |
| 545 // O(n) walks.) | 550 // O(n) walks.) |
| 546 std::multimap<int, int> scrollbar_map_; | 551 std::multimap<int, int> scrollbar_map_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 | 591 |
| 587 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 592 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
| 588 | 593 |
| 589 private: | 594 private: |
| 590 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 595 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
| 591 }; | 596 }; |
| 592 | 597 |
| 593 } // namespace cc | 598 } // namespace cc |
| 594 | 599 |
| 595 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 600 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
| OLD | NEW |