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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h

Issue 2495893002: Implement incremental paint property tree rebuilding (Closed)
Patch Set: Suppress main thread scrolling invalidation failures 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
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 ClipPaintPropertyNode_h 5 #ifndef ClipPaintPropertyNode_h
6 #define ClipPaintPropertyNode_h 6 #define ClipPaintPropertyNode_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/geometry/FloatRoundedRect.h" 9 #include "platform/geometry/FloatRoundedRect.h"
10 #include "platform/graphics/paint/TransformPaintPropertyNode.h" 10 #include "platform/graphics/paint/TransformPaintPropertyNode.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 const TransformPaintPropertyNode* localTransformSpace() const { 48 const TransformPaintPropertyNode* localTransformSpace() const {
49 return m_localTransformSpace.get(); 49 return m_localTransformSpace.get();
50 } 50 }
51 const FloatRoundedRect& clipRect() const { return m_clipRect; } 51 const FloatRoundedRect& clipRect() const { return m_clipRect; }
52 52
53 // Reference to inherited clips, or nullptr if this is the only clip. 53 // Reference to inherited clips, or nullptr if this is the only clip.
54 const ClipPaintPropertyNode* parent() const { return m_parent.get(); } 54 const ClipPaintPropertyNode* parent() const { return m_parent.get(); }
55 bool isRoot() const { return !m_parent; } 55 bool isRoot() const { return !m_parent; }
56 56
57 #if DCHECK_IS_ON()
58 // The clone function is used by FindPropertiesNeedingUpdate.h for recording
59 // a clip node before it has been updated, to later detect changes.
60 PassRefPtr<ClipPaintPropertyNode> clone() const {
61 return adoptRef(
62 new ClipPaintPropertyNode(m_parent, m_localTransformSpace, m_clipRect));
63 }
64
65 // The equality operator is used by FindPropertiesNeedingUpdate.h for checking
66 // if a clip node has changed.
67 bool operator==(const ClipPaintPropertyNode& o) const {
68 return m_parent == o.m_parent &&
69 m_localTransformSpace == o.m_localTransformSpace &&
70 m_clipRect == o.m_clipRect;
71 }
72 #endif
73
57 private: 74 private:
58 ClipPaintPropertyNode( 75 ClipPaintPropertyNode(
59 PassRefPtr<const ClipPaintPropertyNode> parent, 76 PassRefPtr<const ClipPaintPropertyNode> parent,
60 PassRefPtr<const TransformPaintPropertyNode> localTransformSpace, 77 PassRefPtr<const TransformPaintPropertyNode> localTransformSpace,
61 const FloatRoundedRect& clipRect) 78 const FloatRoundedRect& clipRect)
62 : m_parent(parent), 79 : m_parent(parent),
63 m_localTransformSpace(localTransformSpace), 80 m_localTransformSpace(localTransformSpace),
64 m_clipRect(clipRect) {} 81 m_clipRect(clipRect) {}
65 82
66 RefPtr<const ClipPaintPropertyNode> m_parent; 83 RefPtr<const ClipPaintPropertyNode> m_parent;
67 RefPtr<const TransformPaintPropertyNode> m_localTransformSpace; 84 RefPtr<const TransformPaintPropertyNode> m_localTransformSpace;
68 FloatRoundedRect m_clipRect; 85 FloatRoundedRect m_clipRect;
69 }; 86 };
70 87
71 // Redeclared here to avoid ODR issues. 88 // Redeclared here to avoid ODR issues.
72 // See platform/testing/PaintPrinters.h. 89 // See platform/testing/PaintPrinters.h.
73 void PrintTo(const ClipPaintPropertyNode&, std::ostream*); 90 void PrintTo(const ClipPaintPropertyNode&, std::ostream*);
74 91
75 } // namespace blink 92 } // namespace blink
76 93
77 #endif // ClipPaintPropertyNode_h 94 #endif // ClipPaintPropertyNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698