| 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 PaintPropertyTreeBuilder_h | 5 #ifndef PaintPropertyTreeBuilder_h |
| 6 #define PaintPropertyTreeBuilder_h | 6 #define PaintPropertyTreeBuilder_h |
| 7 | 7 |
| 8 #include "platform/geometry/LayoutPoint.h" | 8 #include "platform/geometry/LayoutPoint.h" |
| 9 #include "platform/graphics/paint/ClipPaintPropertyNode.h" | 9 #include "platform/graphics/paint/ClipPaintPropertyNode.h" |
| 10 #include "platform/graphics/paint/EffectPaintPropertyNode.h" | 10 #include "platform/graphics/paint/EffectPaintPropertyNode.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 TransformPaintPropertyNode* transformForFixedPosition; | 57 TransformPaintPropertyNode* transformForFixedPosition; |
| 58 LayoutPoint paintOffsetForFixedPosition; | 58 LayoutPoint paintOffsetForFixedPosition; |
| 59 ClipPaintPropertyNode* clipForFixedPosition; | 59 ClipPaintPropertyNode* clipForFixedPosition; |
| 60 | 60 |
| 61 // The effect hierarchy is applied by the stacking context tree. It is guara
nteed that every | 61 // The effect hierarchy is applied by the stacking context tree. It is guara
nteed that every |
| 62 // DOM descendant is also a stacking context descendant. Therefore, we don't
need extra | 62 // DOM descendant is also a stacking context descendant. Therefore, we don't
need extra |
| 63 // bookkeeping for effect nodes and can generate the effect tree from a DOM-
order traversal. | 63 // bookkeeping for effect nodes and can generate the effect tree from a DOM-
order traversal. |
| 64 EffectPaintPropertyNode* currentEffect; | 64 EffectPaintPropertyNode* currentEffect; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 // Holds references to root property nodes to keep them alive during tree walk. | |
| 68 struct PaintPropertyTreeBuilderRootContext : public PaintPropertyTreeBuilderCont
ext { | |
| 69 RefPtr<TransformPaintPropertyNode> transformRoot; | |
| 70 RefPtr<ClipPaintPropertyNode> clipRoot; | |
| 71 RefPtr<EffectPaintPropertyNode> effectRoot; | |
| 72 }; | |
| 73 | |
| 74 // Creates paint property tree nodes for special things in the layout tree. | 67 // Creates paint property tree nodes for special things in the layout tree. |
| 75 // Special things include but not limit to: overflow clip, transform, fixed-pos,
animation, | 68 // Special things include but not limit to: overflow clip, transform, fixed-pos,
animation, |
| 76 // mask, filter, ... etc. | 69 // mask, filter, ... etc. |
| 77 // It expects to be invoked for each layout tree node in DOM order during InPreP
aint phase. | 70 // It expects to be invoked for each layout tree node in DOM order during InPreP
aint phase. |
| 78 class PaintPropertyTreeBuilder { | 71 class PaintPropertyTreeBuilder { |
| 79 public: | 72 public: |
| 80 void buildTreeRootNodes(FrameView&, PaintPropertyTreeBuilderRootContext&); | 73 void buildTreeRootNodes(FrameView&, PaintPropertyTreeBuilderContext&); |
| 81 void buildTreeNodes(FrameView&, PaintPropertyTreeBuilderContext&); | 74 void buildTreeNodes(FrameView&, PaintPropertyTreeBuilderContext&); |
| 82 void buildTreeNodes(const LayoutObject&, PaintPropertyTreeBuilderContext&); | 75 void buildTreeNodes(const LayoutObject&, PaintPropertyTreeBuilderContext&); |
| 83 | 76 |
| 84 private: | 77 private: |
| 85 static void updatePaintOffsetTranslation(const LayoutObject&, PaintPropertyT
reeBuilderContext&); | 78 static void updatePaintOffsetTranslation(const LayoutObject&, PaintPropertyT
reeBuilderContext&); |
| 86 static void updateTransform(const LayoutObject&, PaintPropertyTreeBuilderCon
text&); | 79 static void updateTransform(const LayoutObject&, PaintPropertyTreeBuilderCon
text&); |
| 87 static void updateEffect(const LayoutObject&, PaintPropertyTreeBuilderContex
t&); | 80 static void updateEffect(const LayoutObject&, PaintPropertyTreeBuilderContex
t&); |
| 88 static void updateCssClip(const LayoutObject&, PaintPropertyTreeBuilderConte
xt&); | 81 static void updateCssClip(const LayoutObject&, PaintPropertyTreeBuilderConte
xt&); |
| 89 static void updateLocalBorderBoxContext(const LayoutObject&, const PaintProp
ertyTreeBuilderContext&); | 82 static void updateLocalBorderBoxContext(const LayoutObject&, const PaintProp
ertyTreeBuilderContext&); |
| 90 static void updateScrollbarPaintOffset(const LayoutObject&, const PaintPrope
rtyTreeBuilderContext&); | 83 static void updateScrollbarPaintOffset(const LayoutObject&, const PaintPrope
rtyTreeBuilderContext&); |
| 91 static void updateOverflowClip(const LayoutObject&, PaintPropertyTreeBuilder
Context&); | 84 static void updateOverflowClip(const LayoutObject&, PaintPropertyTreeBuilder
Context&); |
| 92 static void updatePerspective(const LayoutObject&, PaintPropertyTreeBuilderC
ontext&); | 85 static void updatePerspective(const LayoutObject&, PaintPropertyTreeBuilderC
ontext&); |
| 93 static void updateSvgLocalTransform(const LayoutObject&, PaintPropertyTreeBu
ilderContext&); | 86 static void updateSvgLocalTransform(const LayoutObject&, PaintPropertyTreeBu
ilderContext&); |
| 94 static void updateScrollTranslation(const LayoutObject&, PaintPropertyTreeBu
ilderContext&); | 87 static void updateScrollTranslation(const LayoutObject&, PaintPropertyTreeBu
ilderContext&); |
| 95 static void updateOutOfFlowContext(const LayoutObject&, PaintPropertyTreeBui
lderContext&); | 88 static void updateOutOfFlowContext(const LayoutObject&, PaintPropertyTreeBui
lderContext&); |
| 89 |
| 90 // Holds references to root property nodes to keep them alive during tree wa
lk. |
| 91 RefPtr<TransformPaintPropertyNode> transformRoot; |
| 92 RefPtr<ClipPaintPropertyNode> clipRoot; |
| 93 RefPtr<EffectPaintPropertyNode> effectRoot; |
| 96 }; | 94 }; |
| 97 | 95 |
| 98 } // namespace blink | 96 } // namespace blink |
| 99 | 97 |
| 100 #endif // PaintPropertyTreeBuilder_h | 98 #endif // PaintPropertyTreeBuilder_h |
| OLD | NEW |