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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.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/EffectPaintPropertyNode.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.h b/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.h
index 46cf9c510567796faa2fbd4a8f93fd7ca55a4cd5..d0d51bfbf7170e51ff9963fc4d53911600e7fa46 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.h
@@ -19,16 +19,22 @@ namespace blink {
// TODO(pdr): Support more effects than just opacity.
class PLATFORM_EXPORT EffectPaintPropertyNode : public RefCounted<EffectPaintPropertyNode> {
public:
+ using Value = float;
+
static PassRefPtr<EffectPaintPropertyNode> create(float opacity, PassRefPtr<EffectPaintPropertyNode> parent = nullptr)
{
return adoptRef(new EffectPaintPropertyNode(opacity, parent));
}
+ Value value() const { return m_opacity; }
float opacity() const { return m_opacity; }
// Parent effect or nullptr if this is the root effect.
const EffectPaintPropertyNode* parent() const { return m_parent.get(); }
+ // Moves this node and its subtrees under another parent.
+ void setParent(PassRefPtr<EffectPaintPropertyNode> parent) { m_parent = parent; }
+
private:
EffectPaintPropertyNode(float opacity, PassRefPtr<EffectPaintPropertyNode> parent)
: m_opacity(opacity), m_parent(parent) { }

Powered by Google App Engine
This is Rietveld 408576698