Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Side by Side Diff: third_party/WebKit/Source/core/animation/InvalidatableStyleInterpolation.h

Issue 1379263002: Don't use pairwise keyframe interpolation at fractions 0 and 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_listInterpolationFunctions
Patch Set: Rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/InvalidatableStyleInterpolation.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_isCached(false)
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 InterpolationValue* underlyingValue) const; 49 const InterpolationValue* ensureValidInterpolation(const StyleResolverState& , const InterpolationValue* underlyingValue) const;
50 void clearCache() const;
43 bool isCacheValid(const StyleResolverState&, const InterpolationValue* under lyingValue) const; 51 bool isCacheValid(const StyleResolverState&, const InterpolationValue* under lyingValue) const;
44 bool isNeutralKeyframeActive() const; 52 bool isNeutralKeyframeActive() const;
45 bool maybeCachePairwiseConversion(const StyleResolverState*, const Interpola tionValue* underlyingValue) const; 53 PassOwnPtr<PairwisePrimitiveInterpolation> maybeConvertPairwise(const StyleR esolverState*, const InterpolationValue* underlyingValue) const;
46 PassOwnPtr<InterpolationValue> convertSingleKeyframe(const CSSPropertySpecif icKeyframe&, const StyleResolverState&, const InterpolationValue* underlyingValu e) const; 54 PassOwnPtr<InterpolationValue> convertSingleKeyframe(const CSSPropertySpecif icKeyframe&, const StyleResolverState&, const InterpolationValue* underlyingValu e) 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_isCached;
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/InvalidatableStyleInterpolation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698