| 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/XLinkNames.h" | 8 #include "core/XLinkNames.h" |
| 9 #include "core/animation/CSSColorInterpolationType.h" | 9 #include "core/animation/CSSColorInterpolationType.h" |
| 10 #include "core/animation/CSSImageInterpolationType.h" | 10 #include "core/animation/CSSImageInterpolationType.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "core/animation/ImageSliceStyleInterpolation.h" | 23 #include "core/animation/ImageSliceStyleInterpolation.h" |
| 24 #include "core/animation/InterpolationType.h" | 24 #include "core/animation/InterpolationType.h" |
| 25 #include "core/animation/InvalidatableInterpolation.h" | 25 #include "core/animation/InvalidatableInterpolation.h" |
| 26 #include "core/animation/LegacyStyleInterpolation.h" | 26 #include "core/animation/LegacyStyleInterpolation.h" |
| 27 #include "core/animation/LengthBoxStyleInterpolation.h" | 27 #include "core/animation/LengthBoxStyleInterpolation.h" |
| 28 #include "core/animation/LengthPairStyleInterpolation.h" | 28 #include "core/animation/LengthPairStyleInterpolation.h" |
| 29 #include "core/animation/LengthSVGInterpolation.h" | 29 #include "core/animation/LengthSVGInterpolation.h" |
| 30 #include "core/animation/LengthStyleInterpolation.h" | 30 #include "core/animation/LengthStyleInterpolation.h" |
| 31 #include "core/animation/ListSVGInterpolation.h" | 31 #include "core/animation/ListSVGInterpolation.h" |
| 32 #include "core/animation/ListStyleInterpolation.h" | 32 #include "core/animation/ListStyleInterpolation.h" |
| 33 #include "core/animation/PathSVGInterpolation.h" | |
| 34 #include "core/animation/SVGAngleInterpolationType.h" | 33 #include "core/animation/SVGAngleInterpolationType.h" |
| 35 #include "core/animation/SVGIntegerInterpolationType.h" | 34 #include "core/animation/SVGIntegerInterpolationType.h" |
| 36 #include "core/animation/SVGIntegerOptionalIntegerInterpolationType.h" | 35 #include "core/animation/SVGIntegerOptionalIntegerInterpolationType.h" |
| 37 #include "core/animation/SVGLengthInterpolationType.h" | 36 #include "core/animation/SVGLengthInterpolationType.h" |
| 38 #include "core/animation/SVGNumberInterpolationType.h" | 37 #include "core/animation/SVGNumberInterpolationType.h" |
| 39 #include "core/animation/SVGNumberListInterpolationType.h" | 38 #include "core/animation/SVGNumberListInterpolationType.h" |
| 40 #include "core/animation/SVGNumberOptionalNumberInterpolationType.h" | 39 #include "core/animation/SVGNumberOptionalNumberInterpolationType.h" |
| 40 #include "core/animation/SVGPathInterpolationType.h" |
| 41 #include "core/animation/SVGPointListInterpolationType.h" | 41 #include "core/animation/SVGPointListInterpolationType.h" |
| 42 #include "core/animation/SVGRectInterpolationType.h" | 42 #include "core/animation/SVGRectInterpolationType.h" |
| 43 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" | 43 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" |
| 44 #include "core/animation/SVGTransformListInterpolationType.h" | 44 #include "core/animation/SVGTransformListInterpolationType.h" |
| 45 #include "core/animation/SVGValueInterpolationType.h" | 45 #include "core/animation/SVGValueInterpolationType.h" |
| 46 #include "core/animation/VisibilityStyleInterpolation.h" | 46 #include "core/animation/VisibilityStyleInterpolation.h" |
| 47 #include "core/animation/css/CSSAnimations.h" | 47 #include "core/animation/css/CSSAnimations.h" |
| 48 #include "core/css/CSSPropertyMetadata.h" | 48 #include "core/css/CSSPropertyMetadata.h" |
| 49 #include "core/css/resolver/StyleResolver.h" | 49 #include "core/css/resolver/StyleResolver.h" |
| 50 #include "core/style/ComputedStyle.h" | 50 #include "core/style/ComputedStyle.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } else if (attribute == SVGNames::kernelMatrixAttr | 324 } else if (attribute == SVGNames::kernelMatrixAttr |
| 325 || attribute == SVGNames::rotateAttr | 325 || attribute == SVGNames::rotateAttr |
| 326 || attribute == SVGNames::tableValuesAttr | 326 || attribute == SVGNames::tableValuesAttr |
| 327 || attribute == SVGNames::valuesAttr) { | 327 || attribute == SVGNames::valuesAttr) { |
| 328 applicableTypes->append(adoptPtr(new SVGNumberListInterpolationType(
attribute))); | 328 applicableTypes->append(adoptPtr(new SVGNumberListInterpolationType(
attribute))); |
| 329 } else if (attribute == SVGNames::baseFrequencyAttr | 329 } else if (attribute == SVGNames::baseFrequencyAttr |
| 330 || attribute == SVGNames::kernelUnitLengthAttr | 330 || attribute == SVGNames::kernelUnitLengthAttr |
| 331 || attribute == SVGNames::radiusAttr | 331 || attribute == SVGNames::radiusAttr |
| 332 || attribute == SVGNames::stdDeviationAttr) { | 332 || attribute == SVGNames::stdDeviationAttr) { |
| 333 applicableTypes->append(adoptPtr(new SVGNumberOptionalNumberInterpol
ationType(attribute))); | 333 applicableTypes->append(adoptPtr(new SVGNumberOptionalNumberInterpol
ationType(attribute))); |
| 334 } else if (attribute == SVGNames::dAttr) { |
| 335 applicableTypes->append(adoptPtr(new SVGPathInterpolationType(attrib
ute))); |
| 334 } else if (attribute == SVGNames::pointsAttr) { | 336 } else if (attribute == SVGNames::pointsAttr) { |
| 335 applicableTypes->append(adoptPtr(new SVGPointListInterpolationType(a
ttribute))); | 337 applicableTypes->append(adoptPtr(new SVGPointListInterpolationType(a
ttribute))); |
| 336 } else if (attribute == SVGNames::viewBoxAttr) { | 338 } else if (attribute == SVGNames::viewBoxAttr) { |
| 337 applicableTypes->append(adoptPtr(new SVGRectInterpolationType(attrib
ute))); | 339 applicableTypes->append(adoptPtr(new SVGRectInterpolationType(attrib
ute))); |
| 338 } else if (attribute == SVGNames::gradientTransformAttr | 340 } else if (attribute == SVGNames::gradientTransformAttr |
| 339 || attribute == SVGNames::patternTransformAttr | 341 || attribute == SVGNames::patternTransformAttr |
| 340 || attribute == SVGNames::transformAttr) { | 342 || attribute == SVGNames::transformAttr) { |
| 341 applicableTypes->append(adoptPtr(new SVGTransformListInterpolationTy
pe(attribute))); | 343 applicableTypes->append(adoptPtr(new SVGTransformListInterpolationTy
pe(attribute))); |
| 342 } else if (attribute == HTMLNames::classAttr | 344 } else if (attribute == HTMLNames::classAttr |
| 343 || attribute == SVGNames::clipPathUnitsAttr | 345 || attribute == SVGNames::clipPathUnitsAttr |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 namespace { | 596 namespace { |
| 595 | 597 |
| 596 PassRefPtr<Interpolation> createSVGInterpolation(SVGPropertyBase* fromValue, SVG
PropertyBase* toValue, SVGAnimatedPropertyBase* attribute) | 598 PassRefPtr<Interpolation> createSVGInterpolation(SVGPropertyBase* fromValue, SVG
PropertyBase* toValue, SVGAnimatedPropertyBase* attribute) |
| 597 { | 599 { |
| 598 RefPtr<Interpolation> interpolation = nullptr; | 600 RefPtr<Interpolation> interpolation = nullptr; |
| 599 ASSERT(fromValue->type() == toValue->type()); | 601 ASSERT(fromValue->type() == toValue->type()); |
| 600 switch (fromValue->type()) { | 602 switch (fromValue->type()) { |
| 601 case AnimatedLengthList: | 603 case AnimatedLengthList: |
| 602 interpolation = ListSVGInterpolation<LengthSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); | 604 interpolation = ListSVGInterpolation<LengthSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); |
| 603 break; | 605 break; |
| 604 case AnimatedPath: | |
| 605 interpolation = PathSVGInterpolation::maybeCreate(fromValue, toValue, at
tribute); | |
| 606 break; | |
| 607 | 606 |
| 608 // Handled by SVGInterpolationTypes. | 607 // Handled by SVGInterpolationTypes. |
| 609 case AnimatedAngle: | 608 case AnimatedAngle: |
| 610 case AnimatedInteger: | 609 case AnimatedInteger: |
| 611 case AnimatedIntegerOptionalInteger: | 610 case AnimatedIntegerOptionalInteger: |
| 612 case AnimatedLength: | 611 case AnimatedLength: |
| 613 case AnimatedNumber: | 612 case AnimatedNumber: |
| 614 case AnimatedNumberList: | 613 case AnimatedNumberList: |
| 615 case AnimatedNumberOptionalNumber: | 614 case AnimatedNumberOptionalNumber: |
| 615 case AnimatedPath: |
| 616 case AnimatedPoints: | 616 case AnimatedPoints: |
| 617 case AnimatedRect: | 617 case AnimatedRect: |
| 618 case AnimatedTransformList: | 618 case AnimatedTransformList: |
| 619 ASSERT_NOT_REACHED(); | 619 ASSERT_NOT_REACHED(); |
| 620 // Fallthrough. | 620 // Fallthrough. |
| 621 | 621 |
| 622 // TODO(ericwilligers): Support more animation types. | 622 // TODO(ericwilligers): Support more animation types. |
| 623 default: | 623 default: |
| 624 break; | 624 break; |
| 625 } | 625 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 644 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); | 644 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); |
| 645 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); | 645 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); |
| 646 | 646 |
| 647 if (!fromValue || !toValue) | 647 if (!fromValue || !toValue) |
| 648 return nullptr; | 648 return nullptr; |
| 649 | 649 |
| 650 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); | 650 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); |
| 651 } | 651 } |
| 652 | 652 |
| 653 } // namespace blink | 653 } // namespace blink |
| OLD | NEW |