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" |
11 #include "platform/graphics/paint/ScrollPaintPropertyNode.h" | 11 #include "platform/graphics/paint/ScrollPaintPropertyNode.h" |
12 #include "platform/graphics/paint/TransformPaintPropertyNode.h" | 12 #include "platform/graphics/paint/TransformPaintPropertyNode.h" |
13 #include "wtf/RefPtr.h" | 13 #include "wtf/RefPtr.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class FrameView; | 17 class FrameView; |
| 18 class LayoutBoxModelObject; |
18 class LayoutObject; | 19 class LayoutObject; |
19 | 20 |
20 // The context for PaintPropertyTreeBuilder. | 21 // The context for PaintPropertyTreeBuilder. |
21 // It's responsible for bookkeeping tree state in other order, for example, the | 22 // It's responsible for bookkeeping tree state in other order, for example, the |
22 // most recent position container seen. | 23 // most recent position container seen. |
23 struct PaintPropertyTreeBuilderContext { | 24 struct PaintPropertyTreeBuilderContext { |
24 // State that propagates on the containing block chain (and so is adjusted | 25 // State that propagates on the containing block chain (and so is adjusted |
25 // when an absolute or fixed position object is encountered). | 26 // when an absolute or fixed position object is encountered). |
26 struct ContainingBlockContext { | 27 struct ContainingBlockContext { |
27 // The combination of a transform and paint offset describes a linear space. | 28 // The combination of a transform and paint offset describes a linear space. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // animation, mask, filter, ... etc. | 93 // animation, mask, filter, ... etc. |
93 // It expects to be invoked for each layout tree node in DOM order during | 94 // It expects to be invoked for each layout tree node in DOM order during |
94 // InPrePaint phase. | 95 // InPrePaint phase. |
95 class PaintPropertyTreeBuilder { | 96 class PaintPropertyTreeBuilder { |
96 public: | 97 public: |
97 PaintPropertyTreeBuilderContext setupInitialContext(); | 98 PaintPropertyTreeBuilderContext setupInitialContext(); |
98 // Update the paint properties for a frame and ensure the context is up to | 99 // Update the paint properties for a frame and ensure the context is up to |
99 // date. | 100 // date. |
100 void updateProperties(FrameView&, PaintPropertyTreeBuilderContext&); | 101 void updateProperties(FrameView&, PaintPropertyTreeBuilderContext&); |
101 | 102 |
102 // Update the context to account for positioning. No paint properties are | 103 // Update the context to account for positioning. Paint offset and |
103 // updated but this can affect the current paint offset which will force a | 104 // paint offset translation (if needed) are updated. If paint offset changes |
104 // subtree update. | 105 // we will force subtree update. |
105 void updateContextForBoxPosition(const LayoutObject&, | 106 void updateContextForBoxPosition(const LayoutObject&, |
106 PaintPropertyTreeBuilderContext&); | 107 PaintPropertyTreeBuilderContext&); |
107 | 108 |
108 // Update the paint properties that affect this object (e.g., properties like | 109 // Update the paint properties that affect this object (e.g., properties like |
109 // paint offset translation) and ensure the context is up to date. Also | 110 // paint offset translation) and ensure the context is up to date. Also |
110 // handles updating the object's paintOffset. | 111 // handles updating the object's paintOffset. |
111 void updatePropertiesForSelf(const LayoutObject&, | 112 void updatePropertiesForSelf(const LayoutObject&, |
112 PaintPropertyTreeBuilderContext&); | 113 PaintPropertyTreeBuilderContext&); |
113 // Update the paint properties that affect children of this object (e.g., | 114 // Update the paint properties that affect children of this object (e.g., |
114 // scroll offset transform) and ensure the context is up to date. | 115 // scroll offset transform) and ensure the context is up to date. |
115 void updatePropertiesForChildren(const LayoutObject&, | 116 void updatePropertiesForChildren(const LayoutObject&, |
116 PaintPropertyTreeBuilderContext&); | 117 PaintPropertyTreeBuilderContext&); |
117 | 118 |
118 private: | 119 private: |
| 120 ALWAYS_INLINE static void updatePaintOffset(const LayoutBoxModelObject&, |
| 121 PaintPropertyTreeBuilderContext&); |
119 ALWAYS_INLINE static void updatePaintOffsetTranslation( | 122 ALWAYS_INLINE static void updatePaintOffsetTranslation( |
120 const LayoutObject&, | 123 const LayoutBoxModelObject&, |
121 PaintPropertyTreeBuilderContext&); | 124 PaintPropertyTreeBuilderContext&); |
122 ALWAYS_INLINE static void updateTransform(const LayoutObject&, | 125 ALWAYS_INLINE static void updateTransform(const LayoutObject&, |
123 PaintPropertyTreeBuilderContext&); | 126 PaintPropertyTreeBuilderContext&); |
124 ALWAYS_INLINE static void updateTransformForNonRootSVG( | 127 ALWAYS_INLINE static void updateTransformForNonRootSVG( |
125 const LayoutObject&, | 128 const LayoutObject&, |
126 PaintPropertyTreeBuilderContext&); | 129 PaintPropertyTreeBuilderContext&); |
127 ALWAYS_INLINE static void updateEffect(const LayoutObject&, | 130 ALWAYS_INLINE static void updateEffect(const LayoutObject&, |
128 PaintPropertyTreeBuilderContext&); | 131 PaintPropertyTreeBuilderContext&); |
129 ALWAYS_INLINE static void updateCssClip(const LayoutObject&, | 132 ALWAYS_INLINE static void updateCssClip(const LayoutObject&, |
130 PaintPropertyTreeBuilderContext&); | 133 PaintPropertyTreeBuilderContext&); |
(...skipping 15 matching lines...) Expand all Loading... |
146 const LayoutObject&, | 149 const LayoutObject&, |
147 PaintPropertyTreeBuilderContext&); | 150 PaintPropertyTreeBuilderContext&); |
148 ALWAYS_INLINE static void updateOutOfFlowContext( | 151 ALWAYS_INLINE static void updateOutOfFlowContext( |
149 const LayoutObject&, | 152 const LayoutObject&, |
150 PaintPropertyTreeBuilderContext&); | 153 PaintPropertyTreeBuilderContext&); |
151 }; | 154 }; |
152 | 155 |
153 } // namespace blink | 156 } // namespace blink |
154 | 157 |
155 #endif // PaintPropertyTreeBuilder_h | 158 #endif // PaintPropertyTreeBuilder_h |
OLD | NEW |