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

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..40ed0288c79385d38478fc9005edd95ec2b204ef 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h
@@ -21,6 +21,8 @@ namespace blink {
// and an (optional) parent ClipPaintPropertyNode for inherited clips.
class PLATFORM_EXPORT ClipPaintPropertyNode : public RefCounted<ClipPaintPropertyNode> {
public:
+ using Value = FloatRoundedRect;
pdr. 2016/07/21 21:34:07 Can a refptr to the local transform space be inclu
+
static PassRefPtr<ClipPaintPropertyNode> create(
PassRefPtr<TransformPaintPropertyNode> localTransformSpace,
const FloatRoundedRect& clipRect,
@@ -29,12 +31,28 @@ public:
return adoptRef(new ClipPaintPropertyNode(localTransformSpace, clipRect, parent));
}
+ // This form is required by PaintPropertyTreeBuilder::updateObjectPaintProperties().
+ static PassRefPtr<ClipPaintPropertyNode> create(const Value& value, PassRefPtr<ClipPaintPropertyNode> parent)
+ {
+ return adoptRef(new ClipPaintPropertyNode(nullptr, value, parent));
+ }
+
const TransformPaintPropertyNode* localTransformSpace() const { return m_localTransformSpace.get(); }
+ const Value& value() const { return m_clipRect; }
const FloatRoundedRect& clipRect() const { return m_clipRect; }
// Reference to inherited clips, or nullptr if this is the only clip.
const ClipPaintPropertyNode* parent() const { return m_parent.get(); }
+ // Moves this node and its subtrees under another parent.
+ void setParent(PassRefPtr<ClipPaintPropertyNode> parent) { m_parent = parent; }
+
+ // This is separate from the create() method for child node for two purposes:
+ // 1. to let the method have the same parameter list as the method of other paint
+ // property node classes, so that they can be used in the same template;
pdr. 2016/07/21 21:34:06 Nit: ; -> .
+ // 2. to allow to reuse an existing node in a new tree.
+ void setLocalTransformSpace(PassRefPtr<TransformPaintPropertyNode> localTransformSpace) { m_localTransformSpace = localTransformSpace; }
+
private:
ClipPaintPropertyNode(PassRefPtr<TransformPaintPropertyNode> localTransformSpace, const FloatRoundedRect& clipRect, PassRefPtr<ClipPaintPropertyNode> parent)
: m_localTransformSpace(localTransformSpace), m_clipRect(clipRect), m_parent(parent) { }

Powered by Google App Engine
This is Rietveld 408576698