| 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 14 matching lines...) Expand all Loading... |
| 25 return adoptRefWillBeNoop(new InvalidatableStyleInterpolation(Interpolat
ionTypes, startKeyframe, endKeyframe)); | 25 return adoptRefWillBeNoop(new InvalidatableStyleInterpolation(Interpolat
ionTypes, startKeyframe, endKeyframe)); |
| 26 } | 26 } |
| 27 | 27 |
| 28 virtual void interpolate(int iteration, double fraction); | 28 virtual void interpolate(int iteration, double fraction); |
| 29 virtual void apply(StyleResolverState&) const; | 29 virtual void apply(StyleResolverState&) const; |
| 30 | 30 |
| 31 virtual bool isInvalidatableStyleInterpolation() const { return true; } | 31 virtual bool isInvalidatableStyleInterpolation() const { return true; } |
| 32 | 32 |
| 33 DEFINE_INLINE_VIRTUAL_TRACE() | 33 DEFINE_INLINE_VIRTUAL_TRACE() |
| 34 { | 34 { |
| 35 visitor->trace(m_startKeyframe); | |
| 36 visitor->trace(m_endKeyframe); | |
| 37 visitor->trace(m_cachedConversion); | |
| 38 visitor->trace(m_conversionCheckers); | 35 visitor->trace(m_conversionCheckers); |
| 39 visitor->trace(m_cachedValue); | |
| 40 StyleInterpolation::trace(visitor); | 36 StyleInterpolation::trace(visitor); |
| 41 } | 37 } |
| 42 | 38 |
| 43 private: | 39 private: |
| 44 InvalidatableStyleInterpolation( | 40 InvalidatableStyleInterpolation( |
| 45 const Vector<const InterpolationType*>& InterpolationTypes, | 41 const Vector<const InterpolationType*>& InterpolationTypes, |
| 46 const CSSPropertySpecificKeyframe& startKeyframe, | 42 const CSSPropertySpecificKeyframe& startKeyframe, |
| 47 const CSSPropertySpecificKeyframe& endKeyframe); | 43 const CSSPropertySpecificKeyframe& endKeyframe); |
| 48 | 44 |
| 49 PassOwnPtrWillBeRawPtr<InterpolationValue> maybeConvertUnderlyingValue(const
StyleResolverState&) const; | 45 PassOwnPtr<InterpolationValue> maybeConvertUnderlyingValue(const StyleResolv
erState&) const; |
| 50 void ensureValidInterpolation(const StyleResolverState&, const Interpolation
Value* underlyingValue) const; | 46 void ensureValidInterpolation(const StyleResolverState&, const Interpolation
Value* underlyingValue) const; |
| 51 bool dependsOnUnderlyingValue() const; | 47 bool dependsOnUnderlyingValue() const; |
| 52 bool isCacheValid(const StyleResolverState&, const InterpolationValue* under
lyingValue) const; | 48 bool isCacheValid(const StyleResolverState&, const InterpolationValue* under
lyingValue) const; |
| 53 bool isNeutralKeyframeActive() const; | 49 bool isNeutralKeyframeActive() const; |
| 54 bool maybeCachePairwiseConversion(const StyleResolverState*, const Interpola
tionValue* underlyingValue) const; | 50 bool maybeCachePairwiseConversion(const StyleResolverState*, const Interpola
tionValue* underlyingValue) const; |
| 55 PassOwnPtrWillBeRawPtr<InterpolationValue> convertSingleKeyframe(const CSSPr
opertySpecificKeyframe&, const StyleResolverState&, const InterpolationValue* un
derlyingValue) const; | 51 PassOwnPtr<InterpolationValue> convertSingleKeyframe(const CSSPropertySpecif
icKeyframe&, const StyleResolverState&, const InterpolationValue* underlyingValu
e) const; |
| 56 void setFlagIfInheritUsed(StyleResolverState&) const; | 52 void setFlagIfInheritUsed(StyleResolverState&) const; |
| 57 | 53 |
| 58 const Vector<const InterpolationType*>& m_interpolationTypes; | 54 const Vector<const InterpolationType*>& m_interpolationTypes; |
| 59 RawPtrWillBeMember<const CSSPropertySpecificKeyframe> m_startKeyframe; | 55 const CSSPropertySpecificKeyframe* m_startKeyframe; |
| 60 RawPtrWillBeMember<const CSSPropertySpecificKeyframe> m_endKeyframe; | 56 const CSSPropertySpecificKeyframe* m_endKeyframe; |
| 61 double m_currentFraction; | 57 double m_currentFraction; |
| 62 mutable OwnPtrWillBeMember<PrimitiveInterpolation> m_cachedConversion; | 58 mutable OwnPtr<PrimitiveInterpolation> m_cachedConversion; |
| 63 mutable InterpolationType::ConversionCheckers m_conversionCheckers; | 59 mutable InterpolationType::ConversionCheckers m_conversionCheckers; |
| 64 mutable OwnPtrWillBeMember<InterpolationValue> m_cachedValue; | 60 mutable OwnPtr<InterpolationValue> m_cachedValue; |
| 65 }; | 61 }; |
| 66 | 62 |
| 67 DEFINE_TYPE_CASTS(InvalidatableStyleInterpolation, Interpolation, value, value->
isInvalidatableStyleInterpolation(), value.isInvalidatableStyleInterpolation()); | 63 DEFINE_TYPE_CASTS(InvalidatableStyleInterpolation, Interpolation, value, value->
isInvalidatableStyleInterpolation(), value.isInvalidatableStyleInterpolation()); |
| 68 | 64 |
| 69 } // namespace blink | 65 } // namespace blink |
| 70 | 66 |
| 71 #endif // InvalidatableStyleInterpolation_h | 67 #endif // InvalidatableStyleInterpolation_h |
| OLD | NEW |