Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: third_party/WebKit/Source/core/paint/ObjectPaintProperties.h

Issue 2456113002: Separate property and context updates in PaintPropertyTreeBuilder (Closed)
Patch Set: Cleanup names/comments, fix preserves3d bug Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 ObjectPaintProperties_h 5 #ifndef ObjectPaintProperties_h
6 #define ObjectPaintProperties_h 6 #define ObjectPaintProperties_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "platform/geometry/LayoutPoint.h" 9 #include "platform/geometry/LayoutPoint.h"
10 #include "platform/graphics/paint/ClipPaintPropertyNode.h" 10 #include "platform/graphics/paint/ClipPaintPropertyNode.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // invalidation. 136 // invalidation.
137 ObjectPaintProperties::PropertyTreeStateWithOffset contentsProperties() const; 137 ObjectPaintProperties::PropertyTreeStateWithOffset contentsProperties() const;
138 138
139 void clearPaintOffsetTranslation() { m_paintOffsetTranslation = nullptr; } 139 void clearPaintOffsetTranslation() { m_paintOffsetTranslation = nullptr; }
140 void clearTransform() { m_transform = nullptr; } 140 void clearTransform() { m_transform = nullptr; }
141 void clearEffect() { m_effect = nullptr; } 141 void clearEffect() { m_effect = nullptr; }
142 void clearCssClip() { m_cssClip = nullptr; } 142 void clearCssClip() { m_cssClip = nullptr; }
143 void clearCssClipFixedPosition() { m_cssClipFixedPosition = nullptr; } 143 void clearCssClipFixedPosition() { m_cssClipFixedPosition = nullptr; }
144 void clearInnerBorderRadiusClip() { m_innerBorderRadiusClip = nullptr; } 144 void clearInnerBorderRadiusClip() { m_innerBorderRadiusClip = nullptr; }
145 void clearOverflowClip() { m_overflowClip = nullptr; } 145 void clearOverflowClip() { m_overflowClip = nullptr; }
146 void clearLocalBorderBoxProperties() { m_localBorderBoxProperties = nullptr; }
146 void clearPerspective() { m_perspective = nullptr; } 147 void clearPerspective() { m_perspective = nullptr; }
147 void clearSvgLocalToBorderBoxTransform() { 148 void clearSvgLocalToBorderBoxTransform() {
148 m_svgLocalToBorderBoxTransform = nullptr; 149 m_svgLocalToBorderBoxTransform = nullptr;
149 } 150 }
150 void clearScrollTranslation() { m_scrollTranslation = nullptr; } 151 void clearScrollTranslation() { m_scrollTranslation = nullptr; }
151 void clearScrollbarPaintOffset() { m_scrollbarPaintOffset = nullptr; } 152 void clearScrollbarPaintOffset() { m_scrollbarPaintOffset = nullptr; }
152 void clearScroll() { m_scroll = nullptr; } 153 void clearScroll() { m_scroll = nullptr; }
153 154
154 template <typename... Args> 155 template <typename... Args>
155 TransformPaintPropertyNode* updatePaintOffsetTranslation(Args&&... args) { 156 void updatePaintOffsetTranslation(Args&&... args) {
156 return updateProperty(m_paintOffsetTranslation, 157 updateProperty(m_paintOffsetTranslation, std::forward<Args>(args)...);
157 std::forward<Args>(args)...);
158 } 158 }
159 template <typename... Args> 159 template <typename... Args>
160 TransformPaintPropertyNode* updateTransform(Args&&... args) { 160 void updateTransform(Args&&... args) {
161 return updateProperty(m_transform, std::forward<Args>(args)...); 161 updateProperty(m_transform, std::forward<Args>(args)...);
162 } 162 }
163 template <typename... Args> 163 template <typename... Args>
164 TransformPaintPropertyNode* updatePerspective(Args&&... args) { 164 void updatePerspective(Args&&... args) {
165 return updateProperty(m_perspective, std::forward<Args>(args)...); 165 updateProperty(m_perspective, std::forward<Args>(args)...);
166 } 166 }
167 template <typename... Args> 167 template <typename... Args>
168 TransformPaintPropertyNode* updateSvgLocalToBorderBoxTransform( 168 void updateSvgLocalToBorderBoxTransform(Args&&... args) {
169 Args&&... args) {
170 DCHECK(!scrollTranslation()) << "SVG elements cannot scroll so there " 169 DCHECK(!scrollTranslation()) << "SVG elements cannot scroll so there "
171 "should never be both a scroll translation " 170 "should never be both a scroll translation "
172 "and an SVG local to border box transform."; 171 "and an SVG local to border box transform.";
173 return updateProperty(m_svgLocalToBorderBoxTransform, 172 updateProperty(m_svgLocalToBorderBoxTransform, std::forward<Args>(args)...);
174 std::forward<Args>(args)...);
175 } 173 }
176 template <typename... Args> 174 template <typename... Args>
177 TransformPaintPropertyNode* updateScrollTranslation(Args&&... args) { 175 void updateScrollTranslation(Args&&... args) {
178 DCHECK(!svgLocalToBorderBoxTransform()) 176 DCHECK(!svgLocalToBorderBoxTransform())
179 << "SVG elements cannot scroll so there should never be both a scroll " 177 << "SVG elements cannot scroll so there should never be both a scroll "
180 "translation and an SVG local to border box transform."; 178 "translation and an SVG local to border box transform.";
181 return updateProperty(m_scrollTranslation, std::forward<Args>(args)...); 179 updateProperty(m_scrollTranslation, std::forward<Args>(args)...);
182 } 180 }
183 template <typename... Args> 181 template <typename... Args>
184 TransformPaintPropertyNode* updateScrollbarPaintOffset(Args&&... args) { 182 void updateScrollbarPaintOffset(Args&&... args) {
185 return updateProperty(m_scrollbarPaintOffset, std::forward<Args>(args)...); 183 updateProperty(m_scrollbarPaintOffset, std::forward<Args>(args)...);
186 } 184 }
187 template <typename... Args> 185 template <typename... Args>
188 ScrollPaintPropertyNode* updateScroll(Args&&... args) { 186 void updateScroll(Args&&... args) {
189 return updateProperty(m_scroll, std::forward<Args>(args)...); 187 updateProperty(m_scroll, std::forward<Args>(args)...);
190 } 188 }
191 template <typename... Args> 189 template <typename... Args>
192 EffectPaintPropertyNode* updateEffect(Args&&... args) { 190 void updateEffect(Args&&... args) {
193 return updateProperty(m_effect, std::forward<Args>(args)...); 191 updateProperty(m_effect, std::forward<Args>(args)...);
194 } 192 }
195 template <typename... Args> 193 template <typename... Args>
196 ClipPaintPropertyNode* updateCssClip(Args&&... args) { 194 void updateCssClip(Args&&... args) {
197 return updateProperty(m_cssClip, std::forward<Args>(args)...); 195 updateProperty(m_cssClip, std::forward<Args>(args)...);
198 } 196 }
199 template <typename... Args> 197 template <typename... Args>
200 ClipPaintPropertyNode* updateCssClipFixedPosition(Args&&... args) { 198 void updateCssClipFixedPosition(Args&&... args) {
201 return updateProperty(m_cssClipFixedPosition, std::forward<Args>(args)...); 199 updateProperty(m_cssClipFixedPosition, std::forward<Args>(args)...);
202 } 200 }
203 template <typename... Args> 201 template <typename... Args>
204 ClipPaintPropertyNode* updateInnerBorderRadiusClip(Args&&... args) { 202 void updateInnerBorderRadiusClip(Args&&... args) {
205 return updateProperty(m_innerBorderRadiusClip, std::forward<Args>(args)...); 203 updateProperty(m_innerBorderRadiusClip, std::forward<Args>(args)...);
206 } 204 }
207 template <typename... Args> 205 template <typename... Args>
208 ClipPaintPropertyNode* updateOverflowClip(Args&&... args) { 206 void updateOverflowClip(Args&&... args) {
209 return updateProperty(m_overflowClip, std::forward<Args>(args)...); 207 updateProperty(m_overflowClip, std::forward<Args>(args)...);
210 } 208 }
211 209
212 private: 210 private:
213 ObjectPaintProperties() {} 211 ObjectPaintProperties() {}
214 212
215 template <typename PaintPropertyNode, typename... Args> 213 template <typename PaintPropertyNode, typename... Args>
216 PaintPropertyNode* updateProperty(RefPtr<PaintPropertyNode>& field, 214 void updateProperty(RefPtr<PaintPropertyNode>& field, Args&&... args) {
217 Args&&... args) {
218 if (field) 215 if (field)
219 field->update(std::forward<Args>(args)...); 216 field->update(std::forward<Args>(args)...);
220 else 217 else
221 field = PaintPropertyNode::create(std::forward<Args>(args)...); 218 field = PaintPropertyNode::create(std::forward<Args>(args)...);
222 return field.get();
223 } 219 }
224 220
225 RefPtr<TransformPaintPropertyNode> m_paintOffsetTranslation; 221 RefPtr<TransformPaintPropertyNode> m_paintOffsetTranslation;
226 RefPtr<TransformPaintPropertyNode> m_transform; 222 RefPtr<TransformPaintPropertyNode> m_transform;
227 RefPtr<EffectPaintPropertyNode> m_effect; 223 RefPtr<EffectPaintPropertyNode> m_effect;
228 RefPtr<ClipPaintPropertyNode> m_cssClip; 224 RefPtr<ClipPaintPropertyNode> m_cssClip;
229 RefPtr<ClipPaintPropertyNode> m_cssClipFixedPosition; 225 RefPtr<ClipPaintPropertyNode> m_cssClipFixedPosition;
230 RefPtr<ClipPaintPropertyNode> m_innerBorderRadiusClip; 226 RefPtr<ClipPaintPropertyNode> m_innerBorderRadiusClip;
231 RefPtr<ClipPaintPropertyNode> m_overflowClip; 227 RefPtr<ClipPaintPropertyNode> m_overflowClip;
232 RefPtr<TransformPaintPropertyNode> m_perspective; 228 RefPtr<TransformPaintPropertyNode> m_perspective;
233 // TODO(pdr): Only LayoutSVGRoot needs this and it should be moved there. 229 // TODO(pdr): Only LayoutSVGRoot needs this and it should be moved there.
234 RefPtr<TransformPaintPropertyNode> m_svgLocalToBorderBoxTransform; 230 RefPtr<TransformPaintPropertyNode> m_svgLocalToBorderBoxTransform;
235 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; 231 RefPtr<TransformPaintPropertyNode> m_scrollTranslation;
236 RefPtr<TransformPaintPropertyNode> m_scrollbarPaintOffset; 232 RefPtr<TransformPaintPropertyNode> m_scrollbarPaintOffset;
237 RefPtr<ScrollPaintPropertyNode> m_scroll; 233 RefPtr<ScrollPaintPropertyNode> m_scroll;
238 234
239 std::unique_ptr<PropertyTreeStateWithOffset> m_localBorderBoxProperties; 235 std::unique_ptr<PropertyTreeStateWithOffset> m_localBorderBoxProperties;
240 }; 236 };
241 237
242 } // namespace blink 238 } // namespace blink
243 239
244 #endif // ObjectPaintProperties_h 240 #endif // ObjectPaintProperties_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698