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

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

Issue 2144823006: Reuse existing paint property node is possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 5 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h b/third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h
index 943de30cdc924214168aed3e957b07db631e2ea8..2cabc7b06dcfb4a7e2a65aa4de06fcf3997cacf7 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h
@@ -17,16 +17,23 @@
namespace blink {
// A clip rect created by a css property such as "overflow" or "clip".
-// Along with a refernce to the transform space the clip rect is based on,
+// Along with a reference to the transform space the clip rect is based on,
// and an (optional) parent ClipPaintPropertyNode for inherited clips.
class PLATFORM_EXPORT ClipPaintPropertyNode : public RefCounted<ClipPaintPropertyNode> {
public:
static PassRefPtr<ClipPaintPropertyNode> create(
+ PassRefPtr<ClipPaintPropertyNode> parent,
PassRefPtr<TransformPaintPropertyNode> localTransformSpace,
- const FloatRoundedRect& clipRect,
- PassRefPtr<ClipPaintPropertyNode> parent = nullptr)
+ const FloatRoundedRect& clipRect)
{
- return adoptRef(new ClipPaintPropertyNode(localTransformSpace, clipRect, parent));
+ return adoptRef(new ClipPaintPropertyNode(parent, localTransformSpace, clipRect));
+ }
+
+ void update(PassRefPtr<ClipPaintPropertyNode> parent, PassRefPtr<TransformPaintPropertyNode> localTransformSpace, const FloatRoundedRect& clipRect)
+ {
+ m_parent = parent;
+ m_localTransformSpace = localTransformSpace;
+ m_clipRect = clipRect;
}
const TransformPaintPropertyNode* localTransformSpace() const { return m_localTransformSpace.get(); }
@@ -36,12 +43,12 @@ public:
const ClipPaintPropertyNode* parent() const { return m_parent.get(); }
private:
- ClipPaintPropertyNode(PassRefPtr<TransformPaintPropertyNode> localTransformSpace, const FloatRoundedRect& clipRect, PassRefPtr<ClipPaintPropertyNode> parent)
- : m_localTransformSpace(localTransformSpace), m_clipRect(clipRect), m_parent(parent) { }
+ ClipPaintPropertyNode(PassRefPtr<ClipPaintPropertyNode> parent, PassRefPtr<TransformPaintPropertyNode> localTransformSpace, const FloatRoundedRect& clipRect)
+ : m_parent(parent), m_localTransformSpace(localTransformSpace), m_clipRect(clipRect) { }
- RefPtr<TransformPaintPropertyNode> m_localTransformSpace;
- const FloatRoundedRect m_clipRect;
RefPtr<ClipPaintPropertyNode> m_parent;
+ RefPtr<TransformPaintPropertyNode> m_localTransformSpace;
+ FloatRoundedRect m_clipRect;
};
// Redeclared here to avoid ODR issues.

Powered by Google App Engine
This is Rietveld 408576698