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

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

Issue 863863004: Implemented additive animations for length (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More comprehensive non-negative length layout tests Created 5 years, 10 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/Interpolation.h
diff --git a/Source/core/animation/Interpolation.h b/Source/core/animation/Interpolation.h
index 88f49f15d8fdf6b89d2c699e65d713f8a9c3e446..58c00d6f0d2252223fcad34e86edea912db7fea8 100644
--- a/Source/core/animation/Interpolation.h
+++ b/Source/core/animation/Interpolation.h
@@ -5,6 +5,7 @@
#ifndef Interpolation_h
#define Interpolation_h
+#include "core/animation/AnimationEffect.h"
#include "core/animation/InterpolableValue.h"
#include "platform/heap/Handle.h"
@@ -19,8 +20,19 @@ public:
virtual ~Interpolation();
+ static PassRefPtrWillBeRawPtr<Interpolation> create(PassOwnPtrWillBeRawPtr<InterpolableValue> start, PassOwnPtrWillBeRawPtr<InterpolableValue> end,
+ AnimationEffect::CompositeOperation compositeStart, AnimationEffect::CompositeOperation compositeEnd)
+ {
+ return adoptRefWillBeNoop(new Interpolation(start, end, compositeStart, compositeEnd));
+ }
+
void interpolate(int iteration, double fraction) const;
+ const InterpolableValue& cachedValue() const { return *m_cachedValue.get(); }
+ double cachedUnderlyingFraction() const { return m_cachedUnderlyingFraction; }
+
+ bool isReplaceOnly() const { return m_compositeStart == AnimationEffect::CompositeReplace && m_compositeEnd == AnimationEffect::CompositeReplace; }
alancutter (OOO until 2018) 2015/02/12 05:55:45 We want to just check for UF == 0. Let's not have
+
virtual bool isStyleInterpolation() const { return false; }
virtual bool isLegacyStyleInterpolation() const { return false; }
@@ -29,12 +41,18 @@ public:
protected:
const OwnPtrWillBeMember<InterpolableValue> m_start;
const OwnPtrWillBeMember<InterpolableValue> m_end;
+ const AnimationEffect::CompositeOperation m_compositeStart;
+ const AnimationEffect::CompositeOperation m_compositeEnd;
mutable double m_cachedFraction;
mutable int m_cachedIteration;
mutable OwnPtrWillBeMember<InterpolableValue> m_cachedValue;
+ mutable double m_cachedUnderlyingFraction;
+ // FIXME: Remove old constructor?
Interpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, PassOwnPtrWillBeRawPtr<InterpolableValue> end);
+ Interpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, PassOwnPtrWillBeRawPtr<InterpolableValue> end,
+ AnimationEffect::CompositeOperation compositeStart, AnimationEffect::CompositeOperation compositeEnd);
private:
InterpolableValue* getCachedValueForTesting() const { return m_cachedValue.get(); }

Powered by Google App Engine
This is Rietveld 408576698