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

Unified Diff: Source/core/animation/InterpolationValue.h

Issue 1318143005: Add mutableComponent() interface to InterpolationValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
« no previous file with comments | « Source/core/animation/InterpolationType.h ('k') | Source/core/animation/InvalidatableStyleInterpolation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/InterpolationValue.h
diff --git a/Source/core/animation/InterpolationValue.h b/Source/core/animation/InterpolationValue.h
index 3479fa0203716ad53a30a43fbb89f44b8f4103fc..e37191f026a9801eb6cc720219626836aca2e127 100644
--- a/Source/core/animation/InterpolationValue.h
+++ b/Source/core/animation/InterpolationValue.h
@@ -13,6 +13,18 @@ namespace blink {
class InterpolationType;
+struct InterpolationComponentValue {
+ ALLOW_ONLY_INLINE_ALLOCATION();
+
+ InterpolationComponentValue(PassOwnPtr<InterpolableValue> interpolableValue = nullptr, PassRefPtr<NonInterpolableValue> nonInterpolableValue = nullptr)
+ : interpolableValue(interpolableValue)
+ , nonInterpolableValue(nonInterpolableValue)
+ { }
+
+ OwnPtr<InterpolableValue> interpolableValue;
+ RefPtr<NonInterpolableValue> nonInterpolableValue;
+};
+
class InterpolationValue {
public:
static PassOwnPtr<InterpolationValue> create(const InterpolationType& type, PassOwnPtr<InterpolableValue> interpolableValue, PassRefPtrWillBeRawPtr<NonInterpolableValue> nonInterpolableValue = nullptr)
@@ -22,28 +34,25 @@ public:
PassOwnPtr<InterpolationValue> clone() const
{
- return create(m_type, m_interpolableValue->clone(), m_nonInterpolableValue);
+ return create(m_type, m_component.interpolableValue->clone(), m_component.nonInterpolableValue);
}
const InterpolationType& type() const { return m_type; }
- const InterpolableValue& interpolableValue() const { return *m_interpolableValue; }
- InterpolableValue& interpolableValue() { return *m_interpolableValue; }
- const NonInterpolableValue* nonInterpolableValue() const { return m_nonInterpolableValue.get(); }
+ const InterpolableValue& interpolableValue() const { return *m_component.interpolableValue; }
+ const NonInterpolableValue* nonInterpolableValue() const { return m_component.nonInterpolableValue.get(); }
+
+ InterpolationComponentValue& mutableComponent() { return m_component; }
dstockwell 2015/09/14 00:24:36 The component naming doesn't help here, this sound
alancutter (OOO until 2018) 2015/09/14 00:37:39 This description is an accurate interpretation of
private:
InterpolationValue(const InterpolationType& type, PassOwnPtr<InterpolableValue> interpolableValue, PassRefPtrWillBeRawPtr<NonInterpolableValue> nonInterpolableValue = nullptr)
: m_type(type)
- , m_interpolableValue(interpolableValue)
- , m_nonInterpolableValue(nonInterpolableValue)
+ , m_component(interpolableValue, nonInterpolableValue)
{
- ASSERT(this->m_interpolableValue);
+ ASSERT(m_component.interpolableValue);
}
const InterpolationType& m_type;
- OwnPtr<InterpolableValue> m_interpolableValue;
- RefPtrWillBePersistent<NonInterpolableValue> m_nonInterpolableValue;
-
- friend class InterpolationType;
+ InterpolationComponentValue m_component;
};
} // namespace blink
« no previous file with comments | « Source/core/animation/InterpolationType.h ('k') | Source/core/animation/InvalidatableStyleInterpolation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698