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 #include "core/animation/CSSShadowListInterpolationType.h" | 5 #include "core/animation/CSSShadowListInterpolationType.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/animation/ListInterpolationFunctions.h" | 8 #include "core/animation/ListInterpolationFunctions.h" |
9 #include "core/animation/ShadowInterpolationFunctions.h" | 9 #include "core/animation/ShadowInterpolationFunctions.h" |
10 #include "core/animation/ShadowListPropertyFunctions.h" | 10 #include "core/animation/ShadowListPropertyFunctions.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 return ShadowInterpolationFunctions::MaybeConvertCSSValue( | 109 return ShadowInterpolationFunctions::MaybeConvertCSSValue( |
110 value_list.Item(index)); | 110 value_list.Item(index)); |
111 }); | 111 }); |
112 } | 112 } |
113 | 113 |
114 PairwiseInterpolationValue CSSShadowListInterpolationType::MaybeMergeSingles( | 114 PairwiseInterpolationValue CSSShadowListInterpolationType::MaybeMergeSingles( |
115 InterpolationValue&& start, | 115 InterpolationValue&& start, |
116 InterpolationValue&& end) const { | 116 InterpolationValue&& end) const { |
117 return ListInterpolationFunctions::MaybeMergeSingles( | 117 return ListInterpolationFunctions::MaybeMergeSingles( |
118 std::move(start), std::move(end), | 118 std::move(start), std::move(end), |
| 119 ListInterpolationFunctions::LengthMatchingStrategy::kPadToLargest, |
119 ShadowInterpolationFunctions::MaybeMergeSingles); | 120 ShadowInterpolationFunctions::MaybeMergeSingles); |
120 } | 121 } |
121 | 122 |
122 InterpolationValue | 123 InterpolationValue |
123 CSSShadowListInterpolationType::MaybeConvertStandardPropertyUnderlyingValue( | 124 CSSShadowListInterpolationType::MaybeConvertStandardPropertyUnderlyingValue( |
124 const ComputedStyle& style) const { | 125 const ComputedStyle& style) const { |
125 return ConvertShadowList( | 126 return ConvertShadowList( |
126 ShadowListPropertyFunctions::GetShadowList(CssProperty(), style), | 127 ShadowListPropertyFunctions::GetShadowList(CssProperty(), style), |
127 style.EffectiveZoom()); | 128 style.EffectiveZoom()); |
128 } | 129 } |
129 | 130 |
130 void CSSShadowListInterpolationType::Composite( | 131 void CSSShadowListInterpolationType::Composite( |
131 UnderlyingValueOwner& underlying_value_owner, | 132 UnderlyingValueOwner& underlying_value_owner, |
132 double underlying_fraction, | 133 double underlying_fraction, |
133 const InterpolationValue& value, | 134 const InterpolationValue& value, |
134 double interpolation_fraction) const { | 135 double interpolation_fraction) const { |
135 ListInterpolationFunctions::Composite( | 136 ListInterpolationFunctions::Composite( |
136 underlying_value_owner, underlying_fraction, *this, value, | 137 underlying_value_owner, underlying_fraction, *this, value, |
| 138 ListInterpolationFunctions::LengthMatchingStrategy::kPadToLargest, |
137 ShadowInterpolationFunctions::NonInterpolableValuesAreCompatible, | 139 ShadowInterpolationFunctions::NonInterpolableValuesAreCompatible, |
138 ShadowInterpolationFunctions::Composite); | 140 ShadowInterpolationFunctions::Composite); |
139 } | 141 } |
140 | 142 |
141 static PassRefPtr<ShadowList> CreateShadowList( | 143 static PassRefPtr<ShadowList> CreateShadowList( |
142 const InterpolableValue& interpolable_value, | 144 const InterpolableValue& interpolable_value, |
143 const NonInterpolableValue* non_interpolable_value, | 145 const NonInterpolableValue* non_interpolable_value, |
144 const StyleResolverState& state) { | 146 const StyleResolverState& state) { |
145 const InterpolableList& interpolable_list = | 147 const InterpolableList& interpolable_list = |
146 ToInterpolableList(interpolable_value); | 148 ToInterpolableList(interpolable_value); |
(...skipping 12 matching lines...) Expand all Loading... |
159 void CSSShadowListInterpolationType::ApplyStandardPropertyValue( | 161 void CSSShadowListInterpolationType::ApplyStandardPropertyValue( |
160 const InterpolableValue& interpolable_value, | 162 const InterpolableValue& interpolable_value, |
161 const NonInterpolableValue* non_interpolable_value, | 163 const NonInterpolableValue* non_interpolable_value, |
162 StyleResolverState& state) const { | 164 StyleResolverState& state) const { |
163 ShadowListPropertyFunctions::SetShadowList( | 165 ShadowListPropertyFunctions::SetShadowList( |
164 CssProperty(), *state.Style(), | 166 CssProperty(), *state.Style(), |
165 CreateShadowList(interpolable_value, non_interpolable_value, state)); | 167 CreateShadowList(interpolable_value, non_interpolable_value, state)); |
166 } | 168 } |
167 | 169 |
168 } // namespace blink | 170 } // namespace blink |
OLD | NEW |