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

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..a143354f73e86cd44a0421362d7b6784625bc593 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.h
@@ -19,9 +19,15 @@ namespace blink {
// TODO(pdr): Support more effects than just opacity.
class PLATFORM_EXPORT EffectPaintPropertyNode : public RefCounted<EffectPaintPropertyNode> {
public:
- static PassRefPtr<EffectPaintPropertyNode> create(float opacity, PassRefPtr<EffectPaintPropertyNode> parent = nullptr)
+ static PassRefPtr<EffectPaintPropertyNode> create(PassRefPtr<EffectPaintPropertyNode> parent, float opacity)
{
- return adoptRef(new EffectPaintPropertyNode(opacity, parent));
+ return adoptRef(new EffectPaintPropertyNode(parent, opacity));
+ }
+
+ void update(PassRefPtr<EffectPaintPropertyNode> parent, float opacity)
+ {
+ m_parent = parent;
+ m_opacity = opacity;
}
float opacity() const { return m_opacity; }
@@ -30,11 +36,11 @@ public:
const EffectPaintPropertyNode* parent() const { return m_parent.get(); }
private:
- EffectPaintPropertyNode(float opacity, PassRefPtr<EffectPaintPropertyNode> parent)
- : m_opacity(opacity), m_parent(parent) { }
+ EffectPaintPropertyNode(PassRefPtr<EffectPaintPropertyNode> parent, float opacity)
+ : m_parent(parent), m_opacity(opacity) { }
- const float m_opacity;
RefPtr<EffectPaintPropertyNode> m_parent;
+ float m_opacity;
};
// Redeclared here to avoid ODR issues.

Powered by Google App Engine
This is Rietveld 408576698