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/SVGTransformListInterpolationType.h" | 5 #include "core/animation/SVGTransformListInterpolationType.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/animation/InterpolableValue.h" | 8 #include "core/animation/InterpolableValue.h" |
9 #include "core/animation/InterpolationEnvironment.h" | |
10 #include "core/animation/NonInterpolableValue.h" | 9 #include "core/animation/NonInterpolableValue.h" |
| 10 #include "core/animation/SVGInterpolationEnvironment.h" |
11 #include "core/animation/StringKeyframe.h" | 11 #include "core/animation/StringKeyframe.h" |
12 #include "core/svg/SVGTransform.h" | 12 #include "core/svg/SVGTransform.h" |
13 #include "core/svg/SVGTransformList.h" | 13 #include "core/svg/SVGTransformList.h" |
14 #include "platform/wtf/PtrUtil.h" | 14 #include "platform/wtf/PtrUtil.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 class SVGTransformNonInterpolableValue : public NonInterpolableValue { | 18 class SVGTransformNonInterpolableValue : public NonInterpolableValue { |
19 public: | 19 public: |
20 virtual ~SVGTransformNonInterpolableValue() {} | 20 virtual ~SVGTransformNonInterpolableValue() {} |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 if (underlying) { | 245 if (underlying) { |
246 types.AppendVector(GetTransformTypes(underlying)); | 246 types.AppendVector(GetTransformTypes(underlying)); |
247 interpolable_parts.push_back(underlying.interpolable_value->Clone()); | 247 interpolable_parts.push_back(underlying.interpolable_value->Clone()); |
248 } | 248 } |
249 conversion_checkers.push_back(SVGTransformListChecker::Create(underlying)); | 249 conversion_checkers.push_back(SVGTransformListChecker::Create(underlying)); |
250 } else { | 250 } else { |
251 DCHECK(!keyframe.IsNeutral()); | 251 DCHECK(!keyframe.IsNeutral()); |
252 } | 252 } |
253 | 253 |
254 if (!keyframe.IsNeutral()) { | 254 if (!keyframe.IsNeutral()) { |
255 SVGPropertyBase* svg_value = environment.SvgBaseValue().CloneForAnimation( | 255 SVGPropertyBase* svg_value = |
256 ToSVGPropertySpecificKeyframe(keyframe).Value()); | 256 ToSVGInterpolationEnvironment(environment) |
| 257 .SvgBaseValue() |
| 258 .CloneForAnimation(ToSVGPropertySpecificKeyframe(keyframe).Value()); |
257 InterpolationValue value = MaybeConvertSVGValue(*svg_value); | 259 InterpolationValue value = MaybeConvertSVGValue(*svg_value); |
258 if (!value) | 260 if (!value) |
259 return nullptr; | 261 return nullptr; |
260 types.AppendVector(GetTransformTypes(value)); | 262 types.AppendVector(GetTransformTypes(value)); |
261 interpolable_parts.push_back(std::move(value.interpolable_value)); | 263 interpolable_parts.push_back(std::move(value.interpolable_value)); |
262 } | 264 } |
263 | 265 |
264 std::unique_ptr<InterpolableList> interpolable_list = | 266 std::unique_ptr<InterpolableList> interpolable_list = |
265 InterpolableList::Create(types.size()); | 267 InterpolableList::Create(types.size()); |
266 size_t interpolable_list_index = 0; | 268 size_t interpolable_list_index = 0; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 305 |
304 void SVGTransformListInterpolationType::Composite( | 306 void SVGTransformListInterpolationType::Composite( |
305 UnderlyingValueOwner& underlying_value_owner, | 307 UnderlyingValueOwner& underlying_value_owner, |
306 double underlying_fraction, | 308 double underlying_fraction, |
307 const InterpolationValue& value, | 309 const InterpolationValue& value, |
308 double interpolation_fraction) const { | 310 double interpolation_fraction) const { |
309 underlying_value_owner.Set(*this, value); | 311 underlying_value_owner.Set(*this, value); |
310 } | 312 } |
311 | 313 |
312 } // namespace blink | 314 } // namespace blink |
OLD | NEW |