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

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

Issue 22799020: Web Animations CSS: Support Animation of StyleImage and LengthBox (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Support animation of clip:' Created 7 years, 4 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/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)); }

Powered by Google App Engine
This is Rietveld 408576698