| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 PropertyTreeManager_h | 5 #ifndef PropertyTreeManager_h |
| 6 #define PropertyTreeManager_h | 6 #define PropertyTreeManager_h |
| 7 | 7 |
| 8 #include "wtf/HashMap.h" | 8 #include "wtf/HashMap.h" |
| 9 #include "wtf/HashSet.h" | 9 #include "wtf/HashSet.h" |
| 10 #include "wtf/Noncopyable.h" | 10 #include "wtf/Noncopyable.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 int ensureCompositorTransformNode(const TransformPaintPropertyNode*); | 76 int ensureCompositorTransformNode(const TransformPaintPropertyNode*); |
| 77 int ensureCompositorClipNode(const ClipPaintPropertyNode*); | 77 int ensureCompositorClipNode(const ClipPaintPropertyNode*); |
| 78 int ensureCompositorScrollNode(const ScrollPaintPropertyNode*); | 78 int ensureCompositorScrollNode(const ScrollPaintPropertyNode*); |
| 79 | 79 |
| 80 int switchToEffectNode(const EffectPaintPropertyNode& nextEffect); | 80 int switchToEffectNode(const EffectPaintPropertyNode& nextEffect); |
| 81 int getCurrentCompositorEffectNodeIndex() const { | 81 int getCurrentCompositorEffectNodeIndex() const { |
| 82 return m_effectStack.back().id; | 82 return m_effectStack.back().id; |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Scroll offset has special treatment in the transform and scroll trees. | |
| 86 void updateScrollOffset(const ScrollPaintPropertyNode*); | |
| 87 | |
| 88 private: | 85 private: |
| 89 void buildEffectNodesRecursively(const EffectPaintPropertyNode* nextEffect); | 86 void buildEffectNodesRecursively(const EffectPaintPropertyNode* nextEffect); |
| 90 | 87 |
| 91 cc::TransformTree& transformTree(); | 88 cc::TransformTree& transformTree(); |
| 92 cc::ClipTree& clipTree(); | 89 cc::ClipTree& clipTree(); |
| 93 cc::EffectTree& effectTree(); | 90 cc::EffectTree& effectTree(); |
| 94 cc::ScrollTree& scrollTree(); | 91 cc::ScrollTree& scrollTree(); |
| 95 | 92 |
| 96 const EffectPaintPropertyNode* currentEffectNode() const; | 93 const EffectPaintPropertyNode* currentEffectNode() const; |
| 97 | 94 |
| 95 // Scroll translation has special treatment in the transform and scroll trees. |
| 96 void updateScrollAndScrollTranslationNodes(const TransformPaintPropertyNode*); |
| 97 |
| 98 // Property trees which should be updated by the manager. | 98 // Property trees which should be updated by the manager. |
| 99 cc::PropertyTrees& m_propertyTrees; | 99 cc::PropertyTrees& m_propertyTrees; |
| 100 | 100 |
| 101 // Layer to which transform "owner" layers should be added. These will not | 101 // Layer to which transform "owner" layers should be added. These will not |
| 102 // have any actual children, but at present must exist in the tree. | 102 // have any actual children, but at present must exist in the tree. |
| 103 cc::Layer* m_rootLayer; | 103 cc::Layer* m_rootLayer; |
| 104 | 104 |
| 105 // Maps from Blink-side property tree nodes to cc property node indices. | 105 // Maps from Blink-side property tree nodes to cc property node indices. |
| 106 HashMap<const TransformPaintPropertyNode*, int> m_transformNodeMap; | 106 HashMap<const TransformPaintPropertyNode*, int> m_transformNodeMap; |
| 107 HashMap<const ClipPaintPropertyNode*, int> m_clipNodeMap; | 107 HashMap<const ClipPaintPropertyNode*, int> m_clipNodeMap; |
| 108 HashMap<const ScrollPaintPropertyNode*, int> m_scrollNodeMap; | 108 HashMap<const ScrollPaintPropertyNode*, int> m_scrollNodeMap; |
| 109 | 109 |
| 110 struct BlinkEffectAndCcIdPair { | 110 struct BlinkEffectAndCcIdPair { |
| 111 const EffectPaintPropertyNode* effect; | 111 const EffectPaintPropertyNode* effect; |
| 112 // The cc property tree effect node id, or 'node index', for the cc effect | 112 // The cc property tree effect node id, or 'node index', for the cc effect |
| 113 // node corresponding to the above Blink effect paint property node. | 113 // node corresponding to the above Blink effect paint property node. |
| 114 int id; | 114 int id; |
| 115 }; | 115 }; |
| 116 Vector<BlinkEffectAndCcIdPair> m_effectStack; | 116 Vector<BlinkEffectAndCcIdPair> m_effectStack; |
| 117 | 117 |
| 118 #if DCHECK_IS_ON() | 118 #if DCHECK_IS_ON() |
| 119 HashSet<const EffectPaintPropertyNode*> m_effectNodesConverted; | 119 HashSet<const EffectPaintPropertyNode*> m_effectNodesConverted; |
| 120 #endif | 120 #endif |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace blink | 123 } // namespace blink |
| 124 | 124 |
| 125 #endif // PropertyTreeManager_h | 125 #endif // PropertyTreeManager_h |
| OLD | NEW |