| 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/SVGInterpolationType.h" | 5 #include "core/animation/SVGInterpolationType.h" |
| 6 | 6 |
| 7 #include "core/animation/InterpolationEnvironment.h" | 7 #include "core/animation/SVGInterpolationEnvironment.h" |
| 8 #include "core/animation/StringKeyframe.h" | 8 #include "core/animation/StringKeyframe.h" |
| 9 #include "core/svg/SVGElement.h" | 9 #include "core/svg/SVGElement.h" |
| 10 #include "core/svg/properties/SVGProperty.h" | 10 #include "core/svg/properties/SVGProperty.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 InterpolationValue SVGInterpolationType::MaybeConvertSingle( | 14 InterpolationValue SVGInterpolationType::MaybeConvertSingle( |
| 15 const PropertySpecificKeyframe& keyframe, | 15 const PropertySpecificKeyframe& keyframe, |
| 16 const InterpolationEnvironment& environment, | 16 const InterpolationEnvironment& environment, |
| 17 const InterpolationValue& underlying, | 17 const InterpolationValue& underlying, |
| 18 ConversionCheckers& conversion_checkers) const { | 18 ConversionCheckers& conversion_checkers) const { |
| 19 if (keyframe.IsNeutral()) | 19 if (keyframe.IsNeutral()) |
| 20 return MaybeConvertNeutral(underlying, conversion_checkers); | 20 return MaybeConvertNeutral(underlying, conversion_checkers); |
| 21 | 21 |
| 22 SVGPropertyBase* svg_value = environment.SvgBaseValue().CloneForAnimation( | 22 SVGPropertyBase* svg_value = |
| 23 ToSVGPropertySpecificKeyframe(keyframe).Value()); | 23 ToSVGInterpolationEnvironment(environment) |
| 24 .SvgBaseValue() |
| 25 .CloneForAnimation(ToSVGPropertySpecificKeyframe(keyframe).Value()); |
| 24 return MaybeConvertSVGValue(*svg_value); | 26 return MaybeConvertSVGValue(*svg_value); |
| 25 } | 27 } |
| 26 | 28 |
| 27 InterpolationValue SVGInterpolationType::MaybeConvertUnderlyingValue( | 29 InterpolationValue SVGInterpolationType::MaybeConvertUnderlyingValue( |
| 28 const InterpolationEnvironment& environment) const { | 30 const InterpolationEnvironment& environment) const { |
| 29 return MaybeConvertSVGValue(environment.SvgBaseValue()); | 31 return MaybeConvertSVGValue( |
| 32 ToSVGInterpolationEnvironment(environment).SvgBaseValue()); |
| 30 } | 33 } |
| 31 | 34 |
| 32 void SVGInterpolationType::Apply( | 35 void SVGInterpolationType::Apply( |
| 33 const InterpolableValue& interpolable_value, | 36 const InterpolableValue& interpolable_value, |
| 34 const NonInterpolableValue* non_interpolable_value, | 37 const NonInterpolableValue* non_interpolable_value, |
| 35 InterpolationEnvironment& environment) const { | 38 InterpolationEnvironment& environment) const { |
| 36 environment.SvgElement().SetWebAnimatedAttribute( | 39 ToSVGInterpolationEnvironment(environment) |
| 37 Attribute(), AppliedSVGValue(interpolable_value, non_interpolable_value)); | 40 .SvgElement() |
| 41 .SetWebAnimatedAttribute( |
| 42 Attribute(), |
| 43 AppliedSVGValue(interpolable_value, non_interpolable_value)); |
| 38 } | 44 } |
| 39 | 45 |
| 40 } // namespace blink | 46 } // namespace blink |
| OLD | NEW |