Chromium Code Reviews| Index: Source/core/animation/AnimatableValue.h |
| diff --git a/Source/core/animation/AnimatableValue.h b/Source/core/animation/AnimatableValue.h |
| index 94a65d1caef94df4bc2935393142b5abff923e5e..db675f7a96757a5b2c40f356a308b46da002858b 100644 |
| --- a/Source/core/animation/AnimatableValue.h |
| +++ b/Source/core/animation/AnimatableValue.h |
| @@ -45,9 +45,13 @@ public: |
| static const AnimatableValue* neutralValue(); |
| static PassRefPtr<AnimatableValue> interpolate(const AnimatableValue*, const AnimatableValue*, double fraction); |
| + static PassRefPtr<AnimatableValue> defaultInterpolateTo(const AnimatableValue* left, const AnimatableValue* right, double fraction) { return takeConstRef((fraction < 0.5) ? left : right); } |
| // For noncommutative values read add(A, B) to mean the value A with B composed onto it. |
| static PassRefPtr<AnimatableValue> add(const AnimatableValue*, const AnimatableValue*); |
| + static PassRefPtr<AnimatableValue> defaultAddWith(const AnimatableValue* left, const AnimatableValue* right) { return takeConstRef(right); } |
|
alancutter (OOO until 2018)
2013/08/27 02:37:45
Is there a use for exposing these methods publicly
dstockwell
2013/08/27 05:02:02
This was for AnimatableList, I'll revert it.
|
| + bool isImage() const { return m_type == TypeImage; } |
| + bool isLengthBox() const { return m_type == TypeLengthBox; } |
| bool isNumber() const { return m_type == TypeNumber; } |
| bool isNeutral() const { return m_type == TypeNeutral; } |
| bool isTransform() const { return m_type == TypeTransform; } |
| @@ -55,6 +59,8 @@ public: |
| protected: |
| enum AnimatableType { |
| + TypeImage, |
| + TypeLengthBox, |
| TypeNeutral, |
| TypeNumber, |
| TypeTransform, |
| @@ -70,11 +76,9 @@ protected: |
| } |
| virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const = 0; |
| - static PassRefPtr<AnimatableValue> defaultInterpolateTo(const AnimatableValue* left, const AnimatableValue* right, double fraction) { return takeConstRef((fraction < 0.5) ? left : right); } |
| // For noncommutative values read A->addWith(B) to mean the value A with B composed onto it. |
| virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue*) const = 0; |
| - static PassRefPtr<AnimatableValue> defaultAddWith(const AnimatableValue* left, const AnimatableValue* right) { return takeConstRef(right); } |
| template <class T> |
| static PassRefPtr<T> takeConstRef(const T* value) { return PassRefPtr<T>(const_cast<T*>(value)); } |