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

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

Issue 1215563002: Implement left property animation on InvalidatableStyleInterpolation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 5 years, 6 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: Source/core/animation/InterpolableValue.h
diff --git a/Source/core/animation/InterpolableValue.h b/Source/core/animation/InterpolableValue.h
index 0b6040841c1e767dcf6bd76c4de15bbe4947b842..fe33304b895aa31d26c38526dc857c8b0a5e5ff9 100644
--- a/Source/core/animation/InterpolableValue.h
+++ b/Source/core/animation/InterpolableValue.h
@@ -28,11 +28,11 @@ public:
private:
virtual void interpolate(const InterpolableValue& to, const double progress, InterpolableValue& result) const = 0;
- virtual void add(const InterpolableValue& rhs, InterpolableValue& result) const = 0;
- virtual void multiply(double scalar, InterpolableValue& result) const = 0;
+ virtual void scaleAndAdd(double scale, const InterpolableValue& other) = 0;
friend class Interpolation;
friend class PairwisePrimitiveInterpolation;
+ friend class InvalidatableStyleInterpolation;
// Keep interpolate private, but allow calls within the hierarchy without
// knowledge of type.
@@ -57,8 +57,7 @@ public:
private:
virtual void interpolate(const InterpolableValue& to, const double progress, InterpolableValue& result) const override final;
- virtual void add(const InterpolableValue& rhs, InterpolableValue& result) const override final;
- virtual void multiply(double scalar, InterpolableValue& result) const override final;
+ virtual void scaleAndAdd(double scale, const InterpolableValue& other) override final;
double m_value;
explicit InterpolableNumber(double value)
@@ -81,8 +80,7 @@ public:
private:
virtual void interpolate(const InterpolableValue& to, const double progress, InterpolableValue& result) const override final;
- virtual void add(const InterpolableValue& rhs, InterpolableValue& result) const override final;
- virtual void multiply(double scalar, InterpolableValue& result) const override final { ASSERT_NOT_REACHED(); }
+ virtual void scaleAndAdd(double scale, const InterpolableValue& other) override final { ASSERT_NOT_REACHED(); }
bool m_value;
explicit InterpolableBool(bool value)
@@ -123,6 +121,11 @@ public:
ASSERT(position < m_size);
return m_values[position].get();
}
+ InterpolableValue* get(size_t position)
+ {
+ ASSERT(position < m_size);
+ return m_values[position].get();
+ }
size_t length() const { return m_size; }
virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const override final { return create(*this); }
@@ -130,8 +133,7 @@ public:
private:
virtual void interpolate(const InterpolableValue& to, const double progress, InterpolableValue& result) const override final;
- virtual void add(const InterpolableValue& rhs, InterpolableValue& result) const override final;
- virtual void multiply(double scalar, InterpolableValue& result) const override final;
+ virtual void scaleAndAdd(double scale, const InterpolableValue& other) override final;
explicit InterpolableList(size_t size)
: m_size(size)
, m_values(m_size)
@@ -166,8 +168,7 @@ public:
private:
virtual void interpolate(const InterpolableValue &to, const double progress, InterpolableValue& result) const override final;
- virtual void add(const InterpolableValue& rhs, InterpolableValue& result) const override final { ASSERT_NOT_REACHED(); }
- virtual void multiply(double scalar, InterpolableValue& result) const override final { ASSERT_NOT_REACHED(); }
+ virtual void scaleAndAdd(double scale, const InterpolableValue& other) override final { ASSERT_NOT_REACHED(); }
RefPtrWillBeMember<AnimatableValue> m_value;
InterpolableAnimatableValue(PassRefPtrWillBeRawPtr<AnimatableValue> value)

Powered by Google App Engine
This is Rietveld 408576698