OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef Interpolation_h | 5 #ifndef Interpolation_h |
6 #define Interpolation_h | 6 #define Interpolation_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/animation/InterpolableValue.h" | 9 #include "core/animation/InterpolableValue.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class PropertyHandle; | 14 class PropertyHandle; |
15 | 15 |
16 // Represents an animation's effect between an adjacent pair of PropertySpecific
Keyframes. | 16 // Represents an animation's effect between an adjacent pair of PropertySpecific
Keyframes. |
17 class CORE_EXPORT Interpolation : public RefCounted<Interpolation> { | 17 class CORE_EXPORT Interpolation : public RefCounted<Interpolation> { |
18 WTF_MAKE_NONCOPYABLE(Interpolation); | 18 WTF_MAKE_NONCOPYABLE(Interpolation); |
19 public: | 19 public: |
20 virtual ~Interpolation(); | 20 virtual ~Interpolation(); |
21 | 21 |
22 virtual void interpolate(int iteration, double fraction); | 22 virtual void interpolate(int iteration, double fraction); |
23 | 23 |
24 virtual bool isStyleInterpolation() const { return false; } | 24 virtual bool isStyleInterpolation() const { return false; } |
25 virtual bool isInvalidatableInterpolation() const { return false; } | 25 virtual bool isInvalidatableInterpolation() const { return false; } |
26 virtual bool isLegacyStyleInterpolation() const { return false; } | 26 virtual bool isLegacyStyleInterpolation() const { return false; } |
27 | 27 |
28 virtual PropertyHandle property() const = 0; | 28 virtual PropertyHandle getProperty() const = 0; |
29 virtual bool dependsOnUnderlyingValue() const { return false; } | 29 virtual bool dependsOnUnderlyingValue() const { return false; } |
30 | 30 |
31 protected: | 31 protected: |
32 const OwnPtr<InterpolableValue> m_start; | 32 const OwnPtr<InterpolableValue> m_start; |
33 const OwnPtr<InterpolableValue> m_end; | 33 const OwnPtr<InterpolableValue> m_end; |
34 | 34 |
35 mutable double m_cachedFraction; | 35 mutable double m_cachedFraction; |
36 mutable int m_cachedIteration; | 36 mutable int m_cachedIteration; |
37 mutable OwnPtr<InterpolableValue> m_cachedValue; | 37 mutable OwnPtr<InterpolableValue> m_cachedValue; |
38 | 38 |
39 Interpolation(PassOwnPtr<InterpolableValue> start, PassOwnPtr<InterpolableVa
lue> end); | 39 Interpolation(PassOwnPtr<InterpolableValue> start, PassOwnPtr<InterpolableVa
lue> end); |
40 | 40 |
41 private: | 41 private: |
42 InterpolableValue* getCachedValueForTesting() const { return m_cachedValue.g
et(); } | 42 InterpolableValue* getCachedValueForTesting() const { return m_cachedValue.g
et(); } |
43 | 43 |
44 friend class AnimationInterpolableValueTest; | 44 friend class AnimationInterpolableValueTest; |
45 friend class AnimationInterpolationEffectTest; | 45 friend class AnimationInterpolationEffectTest; |
46 friend class AnimationDoubleStyleInterpolationTest; | 46 friend class AnimationDoubleStyleInterpolationTest; |
47 friend class AnimationVisibilityStyleInterpolationTest; | 47 friend class AnimationVisibilityStyleInterpolationTest; |
48 }; | 48 }; |
49 | 49 |
50 using ActiveInterpolations = Vector<RefPtr<Interpolation>, 1>; | 50 using ActiveInterpolations = Vector<RefPtr<Interpolation>, 1>; |
51 | 51 |
52 } // namespace blink | 52 } // namespace blink |
53 | 53 |
54 #endif // Interpolation_h | 54 #endif // Interpolation_h |
OLD | NEW |