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

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: Fixed AnimationStackTest 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..8b399d50f20304f4424ca48c3dfa5b5c12b347eb 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; }
+
virtual bool isStyleInterpolation() const { return false; }
virtual bool isLegacyStyleInterpolation() const { return false; }
@@ -29,13 +41,20 @@ 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(); }
@@ -46,6 +65,9 @@ private:
friend class AnimationColorStyleInterpolationTest;
};
+using InterpolationPipeline = WillBeHeapVector<RefPtrWillBeMember<Interpolation>>;
+using InterpolationPipelineMap = WillBeHeapHashMap<CSSPropertyID, InterpolationPipeline>;
alancutter (OOO until 2018) 2015/02/17 03:50:56 I'm a bit iffy about having InterpolationPipelineM
+
} // namespace blink
#endif // Interpolation_h

Powered by Google App Engine
This is Rietveld 408576698