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

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: Make Windows not crash Created 5 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
« no previous file with comments | « Source/core/animation/CSSValueInterpolationType.h ('k') | Source/core/animation/InterpolableValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/InterpolableValue.h
diff --git a/Source/core/animation/InterpolableValue.h b/Source/core/animation/InterpolableValue.h
index 3acc20f0ca5c36401020abc63079ff8da9cf78d1..60b584b0015e4cdeab9051a4becad77459705438 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:
void interpolate(const InterpolableValue& to, const double progress, InterpolableValue& result) const final;
- void add(const InterpolableValue& rhs, InterpolableValue& result) const final;
- void multiply(double scalar, InterpolableValue& result) const final;
+ void scaleAndAdd(double scale, const InterpolableValue& other) final;
double m_value;
explicit InterpolableNumber(double value)
@@ -81,8 +80,7 @@ public:
private:
void interpolate(const InterpolableValue& to, const double progress, InterpolableValue& result) const final;
- void add(const InterpolableValue& rhs, InterpolableValue& result) const final;
- void multiply(double scalar, InterpolableValue& result) const final { ASSERT_NOT_REACHED(); }
+ void scaleAndAdd(double scale, const InterpolableValue& other) 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; }
PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const final { return create(*this); }
@@ -130,8 +133,7 @@ public:
private:
void interpolate(const InterpolableValue& to, const double progress, InterpolableValue& result) const final;
- void add(const InterpolableValue& rhs, InterpolableValue& result) const final;
- void multiply(double scalar, InterpolableValue& result) const final;
+ void scaleAndAdd(double scale, const InterpolableValue& other) final;
explicit InterpolableList(size_t size)
: m_size(size)
, m_values(m_size)
@@ -166,8 +168,7 @@ public:
private:
void interpolate(const InterpolableValue &to, const double progress, InterpolableValue& result) const final;
- void add(const InterpolableValue& rhs, InterpolableValue& result) const final { ASSERT_NOT_REACHED(); }
- void multiply(double scalar, InterpolableValue& result) const final { ASSERT_NOT_REACHED(); }
+ void scaleAndAdd(double scale, const InterpolableValue& other) final { ASSERT_NOT_REACHED(); }
RefPtrWillBeMember<AnimatableValue> m_value;
InterpolableAnimatableValue(PassRefPtrWillBeRawPtr<AnimatableValue> value)
« no previous file with comments | « Source/core/animation/CSSValueInterpolationType.h ('k') | Source/core/animation/InterpolableValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698