OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROPERTY_TREE_H_ | 5 #ifndef CC_TREES_PROPERTY_TREE_H_ |
6 #define CC_TREES_PROPERTY_TREE_H_ | 6 #define CC_TREES_PROPERTY_TREE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 class CC_EXPORT ScrollTree final : public PropertyTree<ScrollNode> { | 354 class CC_EXPORT ScrollTree final : public PropertyTree<ScrollNode> { |
355 public: | 355 public: |
356 ScrollTree(); | 356 ScrollTree(); |
357 ~ScrollTree(); | 357 ~ScrollTree(); |
358 | 358 |
359 ScrollTree& operator=(const ScrollTree& from); | 359 ScrollTree& operator=(const ScrollTree& from); |
360 bool operator==(const ScrollTree& other) const; | 360 bool operator==(const ScrollTree& other) const; |
361 | 361 |
362 void clear(); | 362 void clear(); |
363 | 363 |
364 typedef std::unordered_map<int, bool> ScrollbarsEnabledMap; | |
365 | |
366 gfx::ScrollOffset MaxScrollOffset(int scroll_node_id) const; | 364 gfx::ScrollOffset MaxScrollOffset(int scroll_node_id) const; |
367 void OnScrollOffsetAnimated(int layer_id, | 365 void OnScrollOffsetAnimated(int layer_id, |
368 int scroll_tree_index, | 366 int scroll_tree_index, |
369 const gfx::ScrollOffset& scroll_offset, | 367 const gfx::ScrollOffset& scroll_offset, |
370 LayerTreeImpl* layer_tree_impl); | 368 LayerTreeImpl* layer_tree_impl); |
371 gfx::Size scroll_clip_layer_bounds(int scroll_node_id) const; | 369 gfx::Size scroll_clip_layer_bounds(int scroll_node_id) const; |
372 ScrollNode* CurrentlyScrollingNode(); | 370 ScrollNode* CurrentlyScrollingNode(); |
373 const ScrollNode* CurrentlyScrollingNode() const; | 371 const ScrollNode* CurrentlyScrollingNode() const; |
374 #if DCHECK_IS_ON() | 372 #if DCHECK_IS_ON() |
375 int CurrentlyScrollingNodeId() const; | 373 int CurrentlyScrollingNodeId() const; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 #if DCHECK_IS_ON() | 426 #if DCHECK_IS_ON() |
429 void CopyCompleteTreeState(const ScrollTree& other); | 427 void CopyCompleteTreeState(const ScrollTree& other); |
430 #endif | 428 #endif |
431 | 429 |
432 private: | 430 private: |
433 using ScrollOffsetMap = std::unordered_map<int, gfx::ScrollOffset>; | 431 using ScrollOffsetMap = std::unordered_map<int, gfx::ScrollOffset>; |
434 using SyncedScrollOffsetMap = | 432 using SyncedScrollOffsetMap = |
435 std::unordered_map<int, scoped_refptr<SyncedScrollOffset>>; | 433 std::unordered_map<int, scoped_refptr<SyncedScrollOffset>>; |
436 | 434 |
437 int currently_scrolling_node_id_; | 435 int currently_scrolling_node_id_; |
438 ScrollbarsEnabledMap layer_id_to_scrollbars_enabled_map_; | |
439 | 436 |
440 // On the main thread we store the scroll offsets directly since the main | 437 // On the main thread we store the scroll offsets directly since the main |
441 // thread only needs to keep track of the current main thread state. The impl | 438 // thread only needs to keep track of the current main thread state. The impl |
442 // thread stores a map of SyncedProperty instances in order to track | 439 // thread stores a map of SyncedProperty instances in order to track |
443 // additional state necessary to synchronize scroll changes between the main | 440 // additional state necessary to synchronize scroll changes between the main |
444 // and impl threads. | 441 // and impl threads. |
445 ScrollOffsetMap layer_id_to_scroll_offset_map_; | 442 ScrollOffsetMap layer_id_to_scroll_offset_map_; |
446 SyncedScrollOffsetMap layer_id_to_synced_scroll_offset_map_; | 443 SyncedScrollOffsetMap layer_id_to_synced_scroll_offset_map_; |
447 | 444 |
448 SyncedScrollOffset* GetOrCreateSyncedScrollOffset(int layer_id); | 445 SyncedScrollOffset* GetOrCreateSyncedScrollOffset(int layer_id); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; | 650 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; |
654 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, | 651 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, |
655 int effect_id) const; | 652 int effect_id) const; |
656 | 653 |
657 PropertyTreesCachedData cached_data_; | 654 PropertyTreesCachedData cached_data_; |
658 }; | 655 }; |
659 | 656 |
660 } // namespace cc | 657 } // namespace cc |
661 | 658 |
662 #endif // CC_TREES_PROPERTY_TREE_H_ | 659 #endif // CC_TREES_PROPERTY_TREE_H_ |
OLD | NEW |