OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 PrimitiveInterpolation_h | 5 #ifndef PrimitiveInterpolation_h |
6 #define PrimitiveInterpolation_h | 6 #define PrimitiveInterpolation_h |
7 | 7 |
8 #include "core/animation/TypedInterpolationValue.h" | 8 #include "core/animation/TypedInterpolationValue.h" |
9 #include "platform/animation/AnimationUtilities.h" | 9 #include "platform/animation/AnimationUtilities.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 , m_nonInterpolableValue(nonInterpolableValue) | 56 , m_nonInterpolableValue(nonInterpolableValue) |
57 { | 57 { |
58 ASSERT(m_start); | 58 ASSERT(m_start); |
59 ASSERT(m_end); | 59 ASSERT(m_end); |
60 } | 60 } |
61 | 61 |
62 void interpolateValue(double fraction, OwnPtr<TypedInterpolationValue>& resu
lt) const final | 62 void interpolateValue(double fraction, OwnPtr<TypedInterpolationValue>& resu
lt) const final |
63 { | 63 { |
64 ASSERT(result); | 64 ASSERT(result); |
65 ASSERT(&result->type() == &m_type); | 65 ASSERT(&result->type() == &m_type); |
66 ASSERT(result->nonInterpolableValue() == m_nonInterpolableValue.get()); | 66 ASSERT(result->getNonInterpolableValue() == m_nonInterpolableValue.get()
); |
67 m_start->interpolate(*m_end, fraction, *result->mutableValue().interpola
bleValue); | 67 m_start->interpolate(*m_end, fraction, *result->mutableValue().interpola
bleValue); |
68 } | 68 } |
69 | 69 |
70 double interpolateUnderlyingFraction(double start, double end, double fracti
on) const final { return blend(start, end, fraction); } | 70 double interpolateUnderlyingFraction(double start, double end, double fracti
on) const final { return blend(start, end, fraction); } |
71 | 71 |
72 const InterpolationType& m_type; | 72 const InterpolationType& m_type; |
73 OwnPtr<InterpolableValue> m_start; | 73 OwnPtr<InterpolableValue> m_start; |
74 OwnPtr<InterpolableValue> m_end; | 74 OwnPtr<InterpolableValue> m_end; |
75 RefPtr<NonInterpolableValue> m_nonInterpolableValue; | 75 RefPtr<NonInterpolableValue> m_nonInterpolableValue; |
76 }; | 76 }; |
(...skipping 30 matching lines...) Expand all Loading... |
107 bool isFlip() const final { return true; } | 107 bool isFlip() const final { return true; } |
108 | 108 |
109 OwnPtr<TypedInterpolationValue> m_start; | 109 OwnPtr<TypedInterpolationValue> m_start; |
110 OwnPtr<TypedInterpolationValue> m_end; | 110 OwnPtr<TypedInterpolationValue> m_end; |
111 mutable double m_lastFraction; | 111 mutable double m_lastFraction; |
112 }; | 112 }; |
113 | 113 |
114 } // namespace blink | 114 } // namespace blink |
115 | 115 |
116 #endif // PrimitiveInterpolation_h | 116 #endif // PrimitiveInterpolation_h |
OLD | NEW |