Chromium Code Reviews| 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 InvalidatableStyleInterpolation_h | 5 #ifndef InvalidatableStyleInterpolation_h |
| 6 #define InvalidatableStyleInterpolation_h | 6 #define InvalidatableStyleInterpolation_h |
| 7 | 7 |
| 8 #include "core/animation/InterpolationType.h" | 8 #include "core/animation/InterpolationType.h" |
| 9 #include "core/animation/InterpolationValue.h" | 9 #include "core/animation/InterpolationValue.h" |
| 10 #include "core/animation/PrimitiveInterpolation.h" | 10 #include "core/animation/PrimitiveInterpolation.h" |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 | 27 |
| 28 virtual void interpolate(int iteration, double fraction); | 28 virtual void interpolate(int iteration, double fraction); |
| 29 bool dependsOnUnderlyingValue() const; | 29 bool dependsOnUnderlyingValue() const; |
| 30 virtual void apply(StyleResolverState&) const { ASSERT_NOT_REACHED(); } | 30 virtual void apply(StyleResolverState&) const { ASSERT_NOT_REACHED(); } |
| 31 static void applyStack(const ActiveInterpolations&, StyleResolverState&); | 31 static void applyStack(const ActiveInterpolations&, StyleResolverState&); |
| 32 | 32 |
| 33 virtual bool isInvalidatableStyleInterpolation() const { return true; } | 33 virtual bool isInvalidatableStyleInterpolation() const { return true; } |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 InvalidatableStyleInterpolation( | 36 InvalidatableStyleInterpolation( |
| 37 const Vector<const InterpolationType*>& InterpolationTypes, | 37 const Vector<const InterpolationType*>& interpolationTypes, |
| 38 const CSSPropertySpecificKeyframe& startKeyframe, | 38 const CSSPropertySpecificKeyframe& startKeyframe, |
| 39 const CSSPropertySpecificKeyframe& endKeyframe); | 39 const CSSPropertySpecificKeyframe& endKeyframe) |
| 40 : StyleInterpolation(nullptr, nullptr, interpolationTypes.first()->prope rty()) | |
| 41 , m_interpolationTypes(interpolationTypes) | |
| 42 , m_startKeyframe(&startKeyframe) | |
| 43 , m_endKeyframe(&endKeyframe) | |
| 44 , m_currentFraction(std::numeric_limits<double>::quiet_NaN()) | |
| 45 , m_isCachePending(true) | |
|
dstockwell
2015/10/02 03:55:58
Perhaps invert this, m_isCached?
alancutter (OOO until 2018)
2015/10/08 05:18:49
Done.
| |
| 46 { } | |
| 40 | 47 |
| 41 PassOwnPtr<InterpolationValue> maybeConvertUnderlyingValue(const StyleResolv erState&) const; | 48 PassOwnPtr<InterpolationValue> maybeConvertUnderlyingValue(const StyleResolv erState&) const; |
| 42 const InterpolationValue* ensureValidInterpolation(const StyleResolverState& , const UnderlyingValue&) const; | 49 const InterpolationValue* ensureValidInterpolation(const StyleResolverState& , const UnderlyingValue&) const; |
| 50 void clearCache() const; | |
| 43 bool isCacheValid(const StyleResolverState&, const UnderlyingValue&) const; | 51 bool isCacheValid(const StyleResolverState&, const UnderlyingValue&) const; |
| 44 bool isNeutralKeyframeActive() const; | 52 bool isNeutralKeyframeActive() const; |
| 45 bool maybeCachePairwiseConversion(const StyleResolverState*, const Underlyin gValue&) const; | 53 PassOwnPtr<PairwisePrimitiveInterpolation> maybeConvertPairwise(const StyleR esolverState*, const UnderlyingValue&) const; |
| 46 PassOwnPtr<InterpolationValue> convertSingleKeyframe(const CSSPropertySpecif icKeyframe&, const StyleResolverState&, const UnderlyingValue&) const; | 54 PassOwnPtr<InterpolationValue> convertSingleKeyframe(const CSSPropertySpecif icKeyframe&, const StyleResolverState&, const UnderlyingValue&) const; |
| 47 void setFlagIfInheritUsed(StyleResolverState&) const; | 55 void setFlagIfInheritUsed(StyleResolverState&) const; |
| 48 double underlyingFraction() const; | 56 double underlyingFraction() const; |
| 49 | 57 |
| 50 const Vector<const InterpolationType*>& m_interpolationTypes; | 58 const Vector<const InterpolationType*>& m_interpolationTypes; |
| 51 const CSSPropertySpecificKeyframe* m_startKeyframe; | 59 const CSSPropertySpecificKeyframe* m_startKeyframe; |
| 52 const CSSPropertySpecificKeyframe* m_endKeyframe; | 60 const CSSPropertySpecificKeyframe* m_endKeyframe; |
| 53 double m_currentFraction; | 61 double m_currentFraction; |
| 54 mutable OwnPtr<PrimitiveInterpolation> m_cachedConversion; | 62 mutable bool m_isCachePending; |
| 63 mutable OwnPtr<PrimitiveInterpolation> m_cachedPairConversion; | |
| 55 mutable InterpolationType::ConversionCheckers m_conversionCheckers; | 64 mutable InterpolationType::ConversionCheckers m_conversionCheckers; |
| 56 mutable OwnPtr<InterpolationValue> m_cachedValue; | 65 mutable OwnPtr<InterpolationValue> m_cachedValue; |
| 57 }; | 66 }; |
| 58 | 67 |
| 59 DEFINE_TYPE_CASTS(InvalidatableStyleInterpolation, Interpolation, value, value-> isInvalidatableStyleInterpolation(), value.isInvalidatableStyleInterpolation()); | 68 DEFINE_TYPE_CASTS(InvalidatableStyleInterpolation, Interpolation, value, value-> isInvalidatableStyleInterpolation(), value.isInvalidatableStyleInterpolation()); |
| 60 | 69 |
| 61 } // namespace blink | 70 } // namespace blink |
| 62 | 71 |
| 63 #endif // InvalidatableStyleInterpolation_h | 72 #endif // InvalidatableStyleInterpolation_h |
| OLD | NEW |