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/NumberSVGInterpolation.h" | |
34 #include "core/animation/PathSVGInterpolation.h" | 33 #include "core/animation/PathSVGInterpolation.h" |
35 #include "core/animation/SVGAngleInterpolationType.h" | 34 #include "core/animation/SVGAngleInterpolationType.h" |
36 #include "core/animation/SVGIntegerInterpolationType.h" | 35 #include "core/animation/SVGIntegerInterpolationType.h" |
37 #include "core/animation/SVGIntegerOptionalIntegerInterpolationType.h" | 36 #include "core/animation/SVGIntegerOptionalIntegerInterpolationType.h" |
38 #include "core/animation/SVGNumberInterpolationType.h" | 37 #include "core/animation/SVGNumberInterpolationType.h" |
| 38 #include "core/animation/SVGNumberListInterpolationType.h" |
39 #include "core/animation/SVGNumberOptionalNumberInterpolationType.h" | 39 #include "core/animation/SVGNumberOptionalNumberInterpolationType.h" |
40 #include "core/animation/SVGPointListInterpolationType.h" | 40 #include "core/animation/SVGPointListInterpolationType.h" |
41 #include "core/animation/SVGRectInterpolationType.h" | 41 #include "core/animation/SVGRectInterpolationType.h" |
42 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" | 42 #include "core/animation/SVGStrokeDasharrayStyleInterpolation.h" |
43 #include "core/animation/SVGValueInterpolationType.h" | 43 #include "core/animation/SVGValueInterpolationType.h" |
44 #include "core/animation/TransformSVGInterpolation.h" | 44 #include "core/animation/TransformSVGInterpolation.h" |
45 #include "core/animation/VisibilityStyleInterpolation.h" | 45 #include "core/animation/VisibilityStyleInterpolation.h" |
46 #include "core/animation/css/CSSAnimations.h" | 46 #include "core/animation/css/CSSAnimations.h" |
47 #include "core/css/CSSPropertyMetadata.h" | 47 #include "core/css/CSSPropertyMetadata.h" |
48 #include "core/css/resolver/StyleResolver.h" | 48 #include "core/css/resolver/StyleResolver.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 || attribute == SVGNames::pointsAtYAttr | 293 || attribute == SVGNames::pointsAtYAttr |
294 || attribute == SVGNames::pointsAtZAttr | 294 || attribute == SVGNames::pointsAtZAttr |
295 || attribute == SVGNames::scaleAttr | 295 || attribute == SVGNames::scaleAttr |
296 || attribute == SVGNames::seedAttr | 296 || attribute == SVGNames::seedAttr |
297 || attribute == SVGNames::slopeAttr | 297 || attribute == SVGNames::slopeAttr |
298 || attribute == SVGNames::specularConstantAttr | 298 || attribute == SVGNames::specularConstantAttr |
299 || attribute == SVGNames::specularExponentAttr | 299 || attribute == SVGNames::specularExponentAttr |
300 || attribute == SVGNames::surfaceScaleAttr | 300 || attribute == SVGNames::surfaceScaleAttr |
301 || attribute == SVGNames::zAttr) { | 301 || attribute == SVGNames::zAttr) { |
302 applicableTypes->append(adoptPtr(new SVGNumberInterpolationType(attr
ibute))); | 302 applicableTypes->append(adoptPtr(new SVGNumberInterpolationType(attr
ibute))); |
| 303 } else if (attribute == SVGNames::kernelMatrixAttr |
| 304 || attribute == SVGNames::rotateAttr |
| 305 || attribute == SVGNames::tableValuesAttr |
| 306 || attribute == SVGNames::valuesAttr) { |
| 307 applicableTypes->append(adoptPtr(new SVGNumberListInterpolationType(
attribute))); |
303 } else if (attribute == SVGNames::baseFrequencyAttr | 308 } else if (attribute == SVGNames::baseFrequencyAttr |
304 || attribute == SVGNames::kernelUnitLengthAttr | 309 || attribute == SVGNames::kernelUnitLengthAttr |
305 || attribute == SVGNames::radiusAttr | 310 || attribute == SVGNames::radiusAttr |
306 || attribute == SVGNames::stdDeviationAttr) { | 311 || attribute == SVGNames::stdDeviationAttr) { |
307 applicableTypes->append(adoptPtr(new SVGNumberOptionalNumberInterpol
ationType(attribute))); | 312 applicableTypes->append(adoptPtr(new SVGNumberOptionalNumberInterpol
ationType(attribute))); |
308 } else if (attribute == SVGNames::pointsAttr) { | 313 } else if (attribute == SVGNames::pointsAttr) { |
309 applicableTypes->append(adoptPtr(new SVGPointListInterpolationType(a
ttribute))); | 314 applicableTypes->append(adoptPtr(new SVGPointListInterpolationType(a
ttribute))); |
310 } else if (attribute == SVGNames::viewBoxAttr) { | 315 } else if (attribute == SVGNames::viewBoxAttr) { |
311 applicableTypes->append(adoptPtr(new SVGRectInterpolationType(attrib
ute))); | 316 applicableTypes->append(adoptPtr(new SVGRectInterpolationType(attrib
ute))); |
312 } else if (attribute == HTMLNames::classAttr | 317 } else if (attribute == HTMLNames::classAttr |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 PassRefPtr<Interpolation> createSVGInterpolation(SVGPropertyBase* fromValue, SVG
PropertyBase* toValue, SVGAnimatedPropertyBase* attribute) | 571 PassRefPtr<Interpolation> createSVGInterpolation(SVGPropertyBase* fromValue, SVG
PropertyBase* toValue, SVGAnimatedPropertyBase* attribute) |
567 { | 572 { |
568 RefPtr<Interpolation> interpolation = nullptr; | 573 RefPtr<Interpolation> interpolation = nullptr; |
569 ASSERT(fromValue->type() == toValue->type()); | 574 ASSERT(fromValue->type() == toValue->type()); |
570 switch (fromValue->type()) { | 575 switch (fromValue->type()) { |
571 case AnimatedLength: | 576 case AnimatedLength: |
572 return LengthSVGInterpolation::create(fromValue, toValue, attribute); | 577 return LengthSVGInterpolation::create(fromValue, toValue, attribute); |
573 case AnimatedLengthList: | 578 case AnimatedLengthList: |
574 interpolation = ListSVGInterpolation<LengthSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); | 579 interpolation = ListSVGInterpolation<LengthSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); |
575 break; | 580 break; |
576 case AnimatedNumberList: | |
577 interpolation = ListSVGInterpolation<NumberSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); | |
578 break; | |
579 case AnimatedPath: | 581 case AnimatedPath: |
580 interpolation = PathSVGInterpolation::maybeCreate(fromValue, toValue, at
tribute); | 582 interpolation = PathSVGInterpolation::maybeCreate(fromValue, toValue, at
tribute); |
581 break; | 583 break; |
582 case AnimatedTransformList: | 584 case AnimatedTransformList: |
583 interpolation = ListSVGInterpolation<TransformSVGInterpolation>::maybeCr
eate(fromValue, toValue, attribute); | 585 interpolation = ListSVGInterpolation<TransformSVGInterpolation>::maybeCr
eate(fromValue, toValue, attribute); |
584 break; | 586 break; |
585 | 587 |
586 // Handled by SVGInterpolationTypes. | 588 // Handled by SVGInterpolationTypes. |
587 case AnimatedAngle: | 589 case AnimatedAngle: |
588 case AnimatedInteger: | 590 case AnimatedInteger: |
589 case AnimatedIntegerOptionalInteger: | 591 case AnimatedIntegerOptionalInteger: |
590 case AnimatedNumber: | 592 case AnimatedNumber: |
| 593 case AnimatedNumberList: |
591 case AnimatedNumberOptionalNumber: | 594 case AnimatedNumberOptionalNumber: |
592 case AnimatedPoints: | 595 case AnimatedPoints: |
593 case AnimatedRect: | 596 case AnimatedRect: |
594 ASSERT_NOT_REACHED(); | 597 ASSERT_NOT_REACHED(); |
595 // Fallthrough. | 598 // Fallthrough. |
596 | 599 |
597 // TODO(ericwilligers): Support more animation types. | 600 // TODO(ericwilligers): Support more animation types. |
598 default: | 601 default: |
599 break; | 602 break; |
600 } | 603 } |
(...skipping 18 matching lines...) Expand all Loading... |
619 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); | 622 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); |
620 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); | 623 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); |
621 | 624 |
622 if (!fromValue || !toValue) | 625 if (!fromValue || !toValue) |
623 return nullptr; | 626 return nullptr; |
624 | 627 |
625 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); | 628 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); |
626 } | 629 } |
627 | 630 |
628 } // namespace blink | 631 } // namespace blink |
OLD | NEW |