| 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 InvalidatableInterpolation_h | 5 #ifndef InvalidatableInterpolation_h |
| 6 #define InvalidatableInterpolation_h | 6 #define InvalidatableInterpolation_h |
| 7 | 7 |
| 8 #include "core/animation/InterpolationType.h" | 8 #include "core/animation/InterpolationType.h" |
| 9 #include "core/animation/PrimitiveInterpolation.h" | 9 #include "core/animation/PrimitiveInterpolation.h" |
| 10 #include "core/animation/PropertyInterpolationTypesMapping.h" | 10 #include "core/animation/PropertyInterpolationTypesMapping.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 InvalidatableInterpolation(PropertyHandle property, | 42 InvalidatableInterpolation(PropertyHandle property, |
| 43 const InterpolationTypes& interpolationTypes, | 43 const InterpolationTypes& interpolationTypes, |
| 44 PassRefPtr<PropertySpecificKeyframe> startKeyframe, | 44 PassRefPtr<PropertySpecificKeyframe> startKeyframe, |
| 45 PassRefPtr<PropertySpecificKeyframe> endKeyframe) | 45 PassRefPtr<PropertySpecificKeyframe> endKeyframe) |
| 46 : Interpolation(nullptr, nullptr), | 46 : Interpolation(nullptr, nullptr), |
| 47 m_property(property), | 47 m_property(property), |
| 48 m_interpolationTypes(interpolationTypes), | 48 m_interpolationTypes(interpolationTypes), |
| 49 m_startKeyframe(startKeyframe), | 49 m_startKeyframe(startKeyframe), |
| 50 m_endKeyframe(endKeyframe), | 50 m_endKeyframe(endKeyframe), |
| 51 m_currentFraction(std::numeric_limits<double>::quiet_NaN()), | 51 m_currentFraction(std::numeric_limits<double>::quiet_NaN()), |
| 52 m_isCached(false) {} | 52 m_isConversionCached(false) {} |
| 53 | 53 |
| 54 using ConversionCheckers = InterpolationType::ConversionCheckers; | 54 using ConversionCheckers = InterpolationType::ConversionCheckers; |
| 55 | 55 |
| 56 std::unique_ptr<TypedInterpolationValue> maybeConvertUnderlyingValue( | 56 std::unique_ptr<TypedInterpolationValue> maybeConvertUnderlyingValue( |
| 57 const InterpolationEnvironment&) const; | 57 const InterpolationEnvironment&) const; |
| 58 const TypedInterpolationValue* ensureValidInterpolation( | 58 const TypedInterpolationValue* ensureValidConversion( |
| 59 const InterpolationEnvironment&, | 59 const InterpolationEnvironment&, |
| 60 const UnderlyingValueOwner&) const; | 60 const UnderlyingValueOwner&) const; |
| 61 void clearCache() const; | 61 void clearConversionCache() const; |
| 62 bool isCacheValid(const InterpolationEnvironment&, | 62 bool isConversionCacheValid(const InterpolationEnvironment&, |
| 63 const UnderlyingValueOwner&) const; | 63 const UnderlyingValueOwner&) const; |
| 64 bool isNeutralKeyframeActive() const; | 64 bool isNeutralKeyframeActive() const; |
| 65 std::unique_ptr<PairwisePrimitiveInterpolation> maybeConvertPairwise( | 65 std::unique_ptr<PairwisePrimitiveInterpolation> maybeConvertPairwise( |
| 66 const InterpolationEnvironment&, | 66 const InterpolationEnvironment&, |
| 67 const UnderlyingValueOwner&) const; | 67 const UnderlyingValueOwner&) const; |
| 68 std::unique_ptr<TypedInterpolationValue> convertSingleKeyframe( | 68 std::unique_ptr<TypedInterpolationValue> convertSingleKeyframe( |
| 69 const PropertySpecificKeyframe&, | 69 const PropertySpecificKeyframe&, |
| 70 const InterpolationEnvironment&, | 70 const InterpolationEnvironment&, |
| 71 const UnderlyingValueOwner&) const; | 71 const UnderlyingValueOwner&) const; |
| 72 void addConversionCheckers(const InterpolationType&, | 72 void addConversionCheckers(const InterpolationType&, |
| 73 ConversionCheckers&) const; | 73 ConversionCheckers&) const; |
| 74 void setFlagIfInheritUsed(InterpolationEnvironment&) const; | 74 void setFlagIfInheritUsed(InterpolationEnvironment&) const; |
| 75 double underlyingFraction() const; | 75 double underlyingFraction() const; |
| 76 | 76 |
| 77 const PropertyHandle m_property; | 77 const PropertyHandle m_property; |
| 78 const InterpolationTypes& m_interpolationTypes; | 78 const InterpolationTypes& m_interpolationTypes; |
| 79 RefPtr<PropertySpecificKeyframe> m_startKeyframe; | 79 RefPtr<PropertySpecificKeyframe> m_startKeyframe; |
| 80 RefPtr<PropertySpecificKeyframe> m_endKeyframe; | 80 RefPtr<PropertySpecificKeyframe> m_endKeyframe; |
| 81 double m_currentFraction; | 81 double m_currentFraction; |
| 82 mutable bool m_isCached; | 82 mutable bool m_isConversionCached; |
| 83 mutable std::unique_ptr<PrimitiveInterpolation> m_cachedPairConversion; | 83 mutable std::unique_ptr<PrimitiveInterpolation> m_cachedPairConversion; |
| 84 mutable ConversionCheckers m_conversionCheckers; | 84 mutable ConversionCheckers m_conversionCheckers; |
| 85 mutable std::unique_ptr<TypedInterpolationValue> m_cachedValue; | 85 mutable std::unique_ptr<TypedInterpolationValue> m_cachedValue; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 DEFINE_TYPE_CASTS(InvalidatableInterpolation, | 88 DEFINE_TYPE_CASTS(InvalidatableInterpolation, |
| 89 Interpolation, | 89 Interpolation, |
| 90 value, | 90 value, |
| 91 value->isInvalidatableInterpolation(), | 91 value->isInvalidatableInterpolation(), |
| 92 value.isInvalidatableInterpolation()); | 92 value.isInvalidatableInterpolation()); |
| 93 | 93 |
| 94 } // namespace blink | 94 } // namespace blink |
| 95 | 95 |
| 96 #endif // InvalidatableInterpolation_h | 96 #endif // InvalidatableInterpolation_h |
| OLD | NEW |