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

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

Issue 2404213004: Implement incremental paint property tree rebuilding (Closed)
Patch Set: Fix bug in how svg local to border box was updated, no longer crash in tests 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 25 matching lines...) Expand all
36 void update(PassRefPtr<const ClipPaintPropertyNode> parent, 36 void update(PassRefPtr<const ClipPaintPropertyNode> parent,
37 PassRefPtr<const TransformPaintPropertyNode> localTransformSpace, 37 PassRefPtr<const TransformPaintPropertyNode> localTransformSpace,
38 const FloatRoundedRect& clipRect) { 38 const FloatRoundedRect& clipRect) {
39 DCHECK(!isRoot()); 39 DCHECK(!isRoot());
40 DCHECK(parent != this); 40 DCHECK(parent != this);
41 m_parent = parent; 41 m_parent = parent;
42 m_localTransformSpace = localTransformSpace; 42 m_localTransformSpace = localTransformSpace;
43 m_clipRect = clipRect; 43 m_clipRect = clipRect;
44 } 44 }
45 45
46 PassRefPtr<ClipPaintPropertyNode> clone() const {
47 return adoptRef(
48 new ClipPaintPropertyNode(m_parent, m_localTransformSpace, m_clipRect));
49 }
50
51 bool operator==(const ClipPaintPropertyNode& o) const {
52 return m_parent == o.m_parent &&
53 m_localTransformSpace == o.m_localTransformSpace &&
54 m_clipRect == o.m_clipRect;
55 }
56
46 const TransformPaintPropertyNode* localTransformSpace() const { 57 const TransformPaintPropertyNode* localTransformSpace() const {
47 return m_localTransformSpace.get(); 58 return m_localTransformSpace.get();
48 } 59 }
49 const FloatRoundedRect& clipRect() const { return m_clipRect; } 60 const FloatRoundedRect& clipRect() const { return m_clipRect; }
50 61
51 // Reference to inherited clips, or nullptr if this is the only clip. 62 // Reference to inherited clips, or nullptr if this is the only clip.
52 const ClipPaintPropertyNode* parent() const { return m_parent.get(); } 63 const ClipPaintPropertyNode* parent() const { return m_parent.get(); }
53 bool isRoot() const { return !m_parent; } 64 bool isRoot() const { return !m_parent; }
54 65
55 private: 66 private:
(...skipping 10 matching lines...) Expand all
66 FloatRoundedRect m_clipRect; 77 FloatRoundedRect m_clipRect;
67 }; 78 };
68 79
69 // Redeclared here to avoid ODR issues. 80 // Redeclared here to avoid ODR issues.
70 // See platform/testing/PaintPrinters.h. 81 // See platform/testing/PaintPrinters.h.
71 void PrintTo(const ClipPaintPropertyNode&, std::ostream*); 82 void PrintTo(const ClipPaintPropertyNode&, std::ostream*);
72 83
73 } // namespace blink 84 } // namespace blink
74 85
75 #endif // ClipPaintPropertyNode_h 86 #endif // ClipPaintPropertyNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698