| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/animation/StringKeyframe.h" | 6 #include "core/animation/StringKeyframe.h" |
| 7 | 7 |
| 8 #include "core/animation/AngleSVGInterpolation.h" | 8 #include "core/animation/AngleSVGInterpolation.h" |
| 9 #include "core/animation/ColorStyleInterpolation.h" | 9 #include "core/animation/ColorStyleInterpolation.h" |
| 10 #include "core/animation/CompositorAnimations.h" | 10 #include "core/animation/CompositorAnimations.h" |
| 11 #include "core/animation/ConstantStyleInterpolation.h" | 11 #include "core/animation/ConstantStyleInterpolation.h" |
| 12 #include "core/animation/DefaultSVGInterpolation.h" | 12 #include "core/animation/DefaultSVGInterpolation.h" |
| 13 #include "core/animation/DeferredLegacyStyleInterpolation.h" | 13 #include "core/animation/DeferredLegacyStyleInterpolation.h" |
| 14 #include "core/animation/DoubleStyleInterpolation.h" | 14 #include "core/animation/DoubleStyleInterpolation.h" |
| 15 #include "core/animation/ImageSliceStyleInterpolation.h" | 15 #include "core/animation/ImageSliceStyleInterpolation.h" |
| 16 #include "core/animation/ImageStyleInterpolation.h" | 16 #include "core/animation/ImageStyleInterpolation.h" |
| 17 #include "core/animation/IntegerOptionalIntegerSVGInterpolation.h" | 17 #include "core/animation/IntegerOptionalIntegerSVGInterpolation.h" |
| 18 #include "core/animation/LegacyStyleInterpolation.h" | 18 #include "core/animation/LegacyStyleInterpolation.h" |
| 19 #include "core/animation/LengthBoxStyleInterpolation.h" | 19 #include "core/animation/LengthBoxStyleInterpolation.h" |
| 20 #include "core/animation/LengthPairStyleInterpolation.h" | 20 #include "core/animation/LengthPairStyleInterpolation.h" |
| 21 #include "core/animation/LengthStyleInterpolation.h" | 21 #include "core/animation/LengthStyleInterpolation.h" |
| 22 #include "core/animation/ListSVGInterpolation.h" | 22 #include "core/animation/ListSVGInterpolation.h" |
| 23 #include "core/animation/ListStyleInterpolation.h" | 23 #include "core/animation/ListStyleInterpolation.h" |
| 24 #include "core/animation/NumberSVGInterpolation.h" |
| 24 #include "core/animation/PointSVGInterpolation.h" | 25 #include "core/animation/PointSVGInterpolation.h" |
| 25 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" | 26 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" |
| 26 #include "core/animation/ShadowStyleInterpolation.h" | 27 #include "core/animation/ShadowStyleInterpolation.h" |
| 27 #include "core/animation/VisibilityStyleInterpolation.h" | 28 #include "core/animation/VisibilityStyleInterpolation.h" |
| 28 #include "core/animation/css/CSSAnimations.h" | 29 #include "core/animation/css/CSSAnimations.h" |
| 29 #include "core/css/CSSPropertyMetadata.h" | 30 #include "core/css/CSSPropertyMetadata.h" |
| 30 #include "core/css/resolver/StyleResolver.h" | 31 #include "core/css/resolver/StyleResolver.h" |
| 31 #include "core/style/ComputedStyle.h" | 32 #include "core/style/ComputedStyle.h" |
| 32 #include "core/svg/SVGElement.h" | 33 #include "core/svg/SVGElement.h" |
| 33 #include "platform/RuntimeEnabledFeatures.h" | 34 #include "platform/RuntimeEnabledFeatures.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 | 474 |
| 474 PassRefPtrWillBeRawPtr<Interpolation> createSVGInterpolation(SVGPropertyBase* fr
omValue, SVGPropertyBase* toValue, SVGAnimatedPropertyBase* attribute) | 475 PassRefPtrWillBeRawPtr<Interpolation> createSVGInterpolation(SVGPropertyBase* fr
omValue, SVGPropertyBase* toValue, SVGAnimatedPropertyBase* attribute) |
| 475 { | 476 { |
| 476 RefPtrWillBeRawPtr<Interpolation> interpolation; | 477 RefPtrWillBeRawPtr<Interpolation> interpolation; |
| 477 ASSERT(fromValue->type() == toValue->type()); | 478 ASSERT(fromValue->type() == toValue->type()); |
| 478 switch (fromValue->type()) { | 479 switch (fromValue->type()) { |
| 479 case AnimatedAngle: | 480 case AnimatedAngle: |
| 480 if (AngleSVGInterpolation::canCreateFrom(fromValue) && AngleSVGInterpola
tion::canCreateFrom(toValue)) | 481 if (AngleSVGInterpolation::canCreateFrom(fromValue) && AngleSVGInterpola
tion::canCreateFrom(toValue)) |
| 481 return AngleSVGInterpolation::create(fromValue, toValue, attribute); | 482 return AngleSVGInterpolation::create(fromValue, toValue, attribute); |
| 482 break; | 483 break; |
| 484 case AnimatedNumber: |
| 485 return NumberSVGInterpolation::create(fromValue, toValue, attribute); |
| 486 case AnimatedNumberList: |
| 487 interpolation = ListSVGInterpolation<NumberSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); |
| 488 break; |
| 483 case AnimatedIntegerOptionalInteger: | 489 case AnimatedIntegerOptionalInteger: |
| 484 return IntegerOptionalIntegerSVGInterpolation::create(fromValue, toValue
, attribute); | 490 return IntegerOptionalIntegerSVGInterpolation::create(fromValue, toValue
, attribute); |
| 485 case AnimatedPoints: | 491 case AnimatedPoints: |
| 486 interpolation = ListSVGInterpolation<PointSVGInterpolation>::maybeCreate
(fromValue, toValue, attribute); | 492 interpolation = ListSVGInterpolation<PointSVGInterpolation>::maybeCreate
(fromValue, toValue, attribute); |
| 487 break; | 493 break; |
| 488 | 494 |
| 489 // TODO(ericwilligers): Support more animation types. | 495 // TODO(ericwilligers): Support more animation types. |
| 490 default: | 496 default: |
| 491 break; | 497 break; |
| 492 } | 498 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 507 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); | 513 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); |
| 508 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); | 514 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); |
| 509 | 515 |
| 510 if (!fromValue || !toValue) | 516 if (!fromValue || !toValue) |
| 511 return nullptr; | 517 return nullptr; |
| 512 | 518 |
| 513 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); | 519 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); |
| 514 } | 520 } |
| 515 | 521 |
| 516 } | 522 } |
| OLD | NEW |