| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // platform/graphics/paint/README.md for more. | 68 // platform/graphics/paint/README.md for more. |
| 69 // | 69 // |
| 70 // With the above as background, we can now state more clearly a description | 70 // With the above as background, we can now state more clearly a description |
| 71 // of the below set of compositor node methods: they take Blink paint property | 71 // of the below set of compositor node methods: they take Blink paint property |
| 72 // tree nodes as input, create a corresponding compositor property tree node | 72 // tree nodes as input, create a corresponding compositor property tree node |
| 73 // if none yet exists, and return the compositor node's 'node id', a.k.a., | 73 // if none yet exists, and return the compositor node's 'node id', a.k.a., |
| 74 // 'node index'. | 74 // 'node index'. |
| 75 | 75 |
| 76 int ensureCompositorTransformNode(const TransformPaintPropertyNode*); | 76 int ensureCompositorTransformNode(const TransformPaintPropertyNode*); |
| 77 int ensureCompositorClipNode(const ClipPaintPropertyNode*); | 77 int ensureCompositorClipNode(const ClipPaintPropertyNode*); |
| 78 // If a new compositor scroll node is created, this also handles updating |
| 79 // the associated compositor transform node's scroll properties. Blink's |
| 80 // transform nodes are used for scroll offset whereas cc's transform nodes |
| 81 // store the scroll offset in a separate field. |
| 78 int ensureCompositorScrollNode(const ScrollPaintPropertyNode*); | 82 int ensureCompositorScrollNode(const ScrollPaintPropertyNode*); |
| 79 | 83 |
| 80 int switchToEffectNode(const EffectPaintPropertyNode& nextEffect); | 84 int switchToEffectNode(const EffectPaintPropertyNode& nextEffect); |
| 81 int getCurrentCompositorEffectNodeIndex() const { | 85 int getCurrentCompositorEffectNodeIndex() const { |
| 82 return m_effectStack.back().id; | 86 return m_effectStack.back().id; |
| 83 } | 87 } |
| 84 | 88 |
| 85 // Scroll offset has special treatment in the transform and scroll trees. | |
| 86 void updateScrollOffset(int layerId, int scrollId); | |
| 87 | |
| 88 private: | 89 private: |
| 89 void buildEffectNodesRecursively(const EffectPaintPropertyNode* nextEffect); | 90 void buildEffectNodesRecursively(const EffectPaintPropertyNode* nextEffect); |
| 90 | 91 |
| 91 cc::TransformTree& transformTree(); | 92 cc::TransformTree& transformTree(); |
| 92 cc::ClipTree& clipTree(); | 93 cc::ClipTree& clipTree(); |
| 93 cc::EffectTree& effectTree(); | 94 cc::EffectTree& effectTree(); |
| 94 cc::ScrollTree& scrollTree(); | 95 cc::ScrollTree& scrollTree(); |
| 95 | 96 |
| 96 const EffectPaintPropertyNode* currentEffectNode() const; | 97 const EffectPaintPropertyNode* currentEffectNode() const; |
| 97 | 98 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 116 Vector<BlinkEffectAndCcIdPair> m_effectStack; | 117 Vector<BlinkEffectAndCcIdPair> m_effectStack; |
| 117 | 118 |
| 118 #if DCHECK_IS_ON() | 119 #if DCHECK_IS_ON() |
| 119 HashSet<const EffectPaintPropertyNode*> m_effectNodesConverted; | 120 HashSet<const EffectPaintPropertyNode*> m_effectNodesConverted; |
| 120 #endif | 121 #endif |
| 121 }; | 122 }; |
| 122 | 123 |
| 123 } // namespace blink | 124 } // namespace blink |
| 124 | 125 |
| 125 #endif // PropertyTreeManager_h | 126 #endif // PropertyTreeManager_h |
| OLD | NEW |