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

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

Issue 2556013002: Fix paint property under-invalidation checking about reference filters (Closed)
Patch Set: - Created 4 years 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
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"
11 #include "platform/graphics/paint/EffectPaintPropertyNode.h" 11 #include "platform/graphics/paint/EffectPaintPropertyNode.h"
12 #include "platform/graphics/paint/PaintChunkProperties.h" 12 #include "platform/graphics/paint/PaintChunkProperties.h"
13 #include "platform/graphics/paint/PropertyTreeState.h" 13 #include "platform/graphics/paint/PropertyTreeState.h"
14 #include "platform/graphics/paint/ScrollPaintPropertyNode.h" 14 #include "platform/graphics/paint/ScrollPaintPropertyNode.h"
15 #include "platform/graphics/paint/TransformPaintPropertyNode.h" 15 #include "platform/graphics/paint/TransformPaintPropertyNode.h"
16 #include "wtf/PassRefPtr.h" 16 #include "wtf/PassRefPtr.h"
17 #include "wtf/PtrUtil.h" 17 #include "wtf/PtrUtil.h"
18 #include "wtf/RefPtr.h" 18 #include "wtf/RefPtr.h"
19 #include <memory> 19 #include <memory>
20 20
21 #if DCHECK_IS_ON()
22 #include "core/style/FilterOperations.h"
23 #endif
24
21 namespace blink { 25 namespace blink {
22 26
23 // This class stores property tree related information associated with a 27 // This class stores property tree related information associated with a
24 // LayoutObject. 28 // LayoutObject.
25 // Currently there are two groups of information: 29 // Currently there are two groups of information:
26 // 1. The set of property nodes created locally by this LayoutObject. 30 // 1. The set of property nodes created locally by this LayoutObject.
27 // 2. The set of property nodes (inherited, or created locally) and paint offset 31 // 2. The set of property nodes (inherited, or created locally) and paint offset
28 // that can be used to paint the border box of this LayoutObject (see: 32 // that can be used to paint the border box of this LayoutObject (see:
29 // localBorderBoxProperties). 33 // localBorderBoxProperties).
30 class CORE_EXPORT ObjectPaintProperties { 34 class CORE_EXPORT ObjectPaintProperties {
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 if (m_scroll) 280 if (m_scroll)
277 cloned->m_scroll = m_scroll->clone(); 281 cloned->m_scroll = m_scroll->clone();
278 if (m_localBorderBoxProperties) { 282 if (m_localBorderBoxProperties) {
279 auto& state = m_localBorderBoxProperties->propertyTreeState; 283 auto& state = m_localBorderBoxProperties->propertyTreeState;
280 cloned->m_localBorderBoxProperties = 284 cloned->m_localBorderBoxProperties =
281 wrapUnique(new PropertyTreeStateWithOffset( 285 wrapUnique(new PropertyTreeStateWithOffset(
282 m_localBorderBoxProperties->paintOffset, 286 m_localBorderBoxProperties->paintOffset,
283 PropertyTreeState(state.transform(), state.clip(), state.effect(), 287 PropertyTreeState(state.transform(), state.clip(), state.effect(),
284 state.scroll()))); 288 state.scroll())));
285 } 289 }
290 cloned->setStyleFilterOperations(m_styleFilterOperations);
286 return cloned; 291 return cloned;
287 } 292 }
293
294 // Used to check changes of filters, especially reference filters which are
295 // ignored in EffectPaintPropertyNode::operator==() because we have no way to
296 // check equality of SkImageFilter values.
297 const FilterOperations& styleFilterOperations() const {
298 return m_styleFilterOperations;
299 }
300 void setStyleFilterOperations(const FilterOperations& operations) {
301 m_styleFilterOperations = operations;
302 }
303 DEFINE_INLINE_TRACE() { visitor->trace(m_styleFilterOperations); }
288 #endif 304 #endif
289 305
290 private: 306 private:
291 ObjectPaintProperties() {} 307 ObjectPaintProperties() {}
292 308
293 // True if an existing property was deleted, false otherwise. 309 // True if an existing property was deleted, false otherwise.
294 template <typename PaintPropertyNode> 310 template <typename PaintPropertyNode>
295 bool clear(RefPtr<PaintPropertyNode>& field) { 311 bool clear(RefPtr<PaintPropertyNode>& field) {
296 if (field) { 312 if (field) {
297 field = nullptr; 313 field = nullptr;
(...skipping 21 matching lines...) Expand all
319 RefPtr<ClipPaintPropertyNode> m_innerBorderRadiusClip; 335 RefPtr<ClipPaintPropertyNode> m_innerBorderRadiusClip;
320 RefPtr<ClipPaintPropertyNode> m_overflowClip; 336 RefPtr<ClipPaintPropertyNode> m_overflowClip;
321 RefPtr<TransformPaintPropertyNode> m_perspective; 337 RefPtr<TransformPaintPropertyNode> m_perspective;
322 // TODO(pdr): Only LayoutSVGRoot needs this and it should be moved there. 338 // TODO(pdr): Only LayoutSVGRoot needs this and it should be moved there.
323 RefPtr<TransformPaintPropertyNode> m_svgLocalToBorderBoxTransform; 339 RefPtr<TransformPaintPropertyNode> m_svgLocalToBorderBoxTransform;
324 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; 340 RefPtr<TransformPaintPropertyNode> m_scrollTranslation;
325 RefPtr<TransformPaintPropertyNode> m_scrollbarPaintOffset; 341 RefPtr<TransformPaintPropertyNode> m_scrollbarPaintOffset;
326 RefPtr<ScrollPaintPropertyNode> m_scroll; 342 RefPtr<ScrollPaintPropertyNode> m_scroll;
327 343
328 std::unique_ptr<PropertyTreeStateWithOffset> m_localBorderBoxProperties; 344 std::unique_ptr<PropertyTreeStateWithOffset> m_localBorderBoxProperties;
345
346 #if DCHECK_IS_ON()
347 FilterOperations m_styleFilterOperations;
348 #endif
329 }; 349 };
330 350
331 } // namespace blink 351 } // namespace blink
332 352
333 #endif // ObjectPaintProperties_h 353 #endif // ObjectPaintProperties_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698