| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SKY_ENGINE_CORE_ANIMATION_INTERPOLATION_H_ | |
| 6 #define SKY_ENGINE_CORE_ANIMATION_INTERPOLATION_H_ | |
| 7 | |
| 8 #include "sky/engine/core/animation/InterpolableValue.h" | |
| 9 #include "sky/engine/platform/heap/Handle.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 class Interpolation : public RefCounted<Interpolation> { | |
| 14 DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(Interpolation); | |
| 15 public: | |
| 16 static PassRefPtr<Interpolation> create(PassOwnPtr<InterpolableValue> start,
PassOwnPtr<InterpolableValue> end) | |
| 17 { | |
| 18 return adoptRef(new Interpolation(start, end)); | |
| 19 } | |
| 20 | |
| 21 void interpolate(int iteration, double fraction) const; | |
| 22 | |
| 23 virtual bool isStyleInterpolation() const { return false; } | |
| 24 virtual bool isLegacyStyleInterpolation() const { return false; } | |
| 25 | |
| 26 protected: | |
| 27 const OwnPtr<InterpolableValue> m_start; | |
| 28 const OwnPtr<InterpolableValue> m_end; | |
| 29 | |
| 30 mutable double m_cachedFraction; | |
| 31 mutable int m_cachedIteration; | |
| 32 mutable OwnPtr<InterpolableValue> m_cachedValue; | |
| 33 | |
| 34 Interpolation(PassOwnPtr<InterpolableValue> start, PassOwnPtr<InterpolableVa
lue> end); | |
| 35 | |
| 36 private: | |
| 37 InterpolableValue* getCachedValueForTesting() const { return m_cachedValue.g
et(); } | |
| 38 | |
| 39 friend class AnimationInterpolableValueTest; | |
| 40 friend class AnimationInterpolationEffectTest; | |
| 41 }; | |
| 42 | |
| 43 } | |
| 44 | |
| 45 #endif // SKY_ENGINE_CORE_ANIMATION_INTERPOLATION_H_ | |
| OLD | NEW |