OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "core/animation/CSSPathInterpolationType.h" | 5 #include "core/animation/CSSPathInterpolationType.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/animation/PathInterpolationFunctions.h" | 8 #include "core/animation/PathInterpolationFunctions.h" |
9 #include "core/css/CSSIdentifierValue.h" | 9 #include "core/css/CSSIdentifierValue.h" |
10 #include "core/css/CSSPathValue.h" | 10 #include "core/css/CSSPathValue.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 return PathInterpolationFunctions::MaybeConvertNeutral(underlying, | 43 return PathInterpolationFunctions::MaybeConvertNeutral(underlying, |
44 conversion_checkers); | 44 conversion_checkers); |
45 } | 45 } |
46 | 46 |
47 InterpolationValue CSSPathInterpolationType::MaybeConvertInitial( | 47 InterpolationValue CSSPathInterpolationType::MaybeConvertInitial( |
48 const StyleResolverState&, | 48 const StyleResolverState&, |
49 ConversionCheckers&) const { | 49 ConversionCheckers&) const { |
50 return PathInterpolationFunctions::ConvertValue(nullptr); | 50 return PathInterpolationFunctions::ConvertValue(nullptr); |
51 } | 51 } |
52 | 52 |
53 class InheritedPathChecker : public InterpolationType::ConversionChecker { | 53 class InheritedPathChecker : public CSSInterpolationType::CSSConversionChecker { |
54 public: | 54 public: |
55 static std::unique_ptr<InheritedPathChecker> Create( | 55 static std::unique_ptr<InheritedPathChecker> Create( |
56 PassRefPtr<StylePath> style_path) { | 56 PassRefPtr<StylePath> style_path) { |
57 return WTF::WrapUnique(new InheritedPathChecker(std::move(style_path))); | 57 return WTF::WrapUnique(new InheritedPathChecker(std::move(style_path))); |
58 } | 58 } |
59 | 59 |
60 private: | 60 private: |
61 InheritedPathChecker(PassRefPtr<StylePath> style_path) | 61 InheritedPathChecker(PassRefPtr<StylePath> style_path) |
62 : style_path_(std::move(style_path)) {} | 62 : style_path_(std::move(style_path)) {} |
63 | 63 |
64 bool IsValid(const InterpolationEnvironment& environment, | 64 bool IsValid(const StyleResolverState& state, |
65 const InterpolationValue& underlying) const final { | 65 const InterpolationValue& underlying) const final { |
66 return environment.GetState().ParentStyle()->SvgStyle().D() == | 66 return state.ParentStyle()->SvgStyle().D() == style_path_.Get(); |
67 style_path_.Get(); | |
68 } | 67 } |
69 | 68 |
70 const RefPtr<StylePath> style_path_; | 69 const RefPtr<StylePath> style_path_; |
71 }; | 70 }; |
72 | 71 |
73 InterpolationValue CSSPathInterpolationType::MaybeConvertInherit( | 72 InterpolationValue CSSPathInterpolationType::MaybeConvertInherit( |
74 const StyleResolverState& state, | 73 const StyleResolverState& state, |
75 ConversionCheckers& conversion_checkers) const { | 74 ConversionCheckers& conversion_checkers) const { |
76 DCHECK_EQ(CssProperty(), CSSPropertyD); | 75 DCHECK_EQ(CssProperty(), CSSPropertyD); |
77 if (!state.ParentStyle()) | 76 if (!state.ParentStyle()) |
(...skipping 25 matching lines...) Expand all Loading... |
103 } | 102 } |
104 | 103 |
105 PairwiseInterpolationValue CSSPathInterpolationType::MaybeMergeSingles( | 104 PairwiseInterpolationValue CSSPathInterpolationType::MaybeMergeSingles( |
106 InterpolationValue&& start, | 105 InterpolationValue&& start, |
107 InterpolationValue&& end) const { | 106 InterpolationValue&& end) const { |
108 return PathInterpolationFunctions::MaybeMergeSingles(std::move(start), | 107 return PathInterpolationFunctions::MaybeMergeSingles(std::move(start), |
109 std::move(end)); | 108 std::move(end)); |
110 } | 109 } |
111 | 110 |
112 } // namespace blink | 111 } // namespace blink |
OLD | NEW |