| 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 "core/animation/StringKeyframe.h" | 5 #include "core/animation/StringKeyframe.h" |
| 6 | 6 |
| 7 #include "core/XLinkNames.h" | 7 #include "core/XLinkNames.h" |
| 8 #include "core/animation/CSSColorInterpolationType.h" | 8 #include "core/animation/CSSColorInterpolationType.h" |
| 9 #include "core/animation/CSSFontWeightInterpolationType.h" | 9 #include "core/animation/CSSFontWeightInterpolationType.h" |
| 10 #include "core/animation/CSSImageInterpolationType.h" | 10 #include "core/animation/CSSImageInterpolationType.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "core/animation/DefaultSVGInterpolation.h" | 21 #include "core/animation/DefaultSVGInterpolation.h" |
| 22 #include "core/animation/DeferredLegacyStyleInterpolation.h" | 22 #include "core/animation/DeferredLegacyStyleInterpolation.h" |
| 23 #include "core/animation/DoubleStyleInterpolation.h" | 23 #include "core/animation/DoubleStyleInterpolation.h" |
| 24 #include "core/animation/FilterStyleInterpolation.h" | 24 #include "core/animation/FilterStyleInterpolation.h" |
| 25 #include "core/animation/ImageSliceStyleInterpolation.h" | 25 #include "core/animation/ImageSliceStyleInterpolation.h" |
| 26 #include "core/animation/InterpolationType.h" | 26 #include "core/animation/InterpolationType.h" |
| 27 #include "core/animation/InvalidatableInterpolation.h" | 27 #include "core/animation/InvalidatableInterpolation.h" |
| 28 #include "core/animation/LegacyStyleInterpolation.h" | 28 #include "core/animation/LegacyStyleInterpolation.h" |
| 29 #include "core/animation/LengthBoxStyleInterpolation.h" | 29 #include "core/animation/LengthBoxStyleInterpolation.h" |
| 30 #include "core/animation/LengthPairStyleInterpolation.h" | 30 #include "core/animation/LengthPairStyleInterpolation.h" |
| 31 #include "core/animation/LengthSVGInterpolation.h" | |
| 32 #include "core/animation/LengthStyleInterpolation.h" | 31 #include "core/animation/LengthStyleInterpolation.h" |
| 33 #include "core/animation/ListSVGInterpolation.h" | |
| 34 #include "core/animation/ListStyleInterpolation.h" | 32 #include "core/animation/ListStyleInterpolation.h" |
| 35 #include "core/animation/SVGAngleInterpolationType.h" | 33 #include "core/animation/SVGAngleInterpolationType.h" |
| 36 #include "core/animation/SVGIntegerInterpolationType.h" | 34 #include "core/animation/SVGIntegerInterpolationType.h" |
| 37 #include "core/animation/SVGIntegerOptionalIntegerInterpolationType.h" | 35 #include "core/animation/SVGIntegerOptionalIntegerInterpolationType.h" |
| 38 #include "core/animation/SVGLengthInterpolationType.h" | 36 #include "core/animation/SVGLengthInterpolationType.h" |
| 37 #include "core/animation/SVGLengthListInterpolationType.h" |
| 39 #include "core/animation/SVGNumberInterpolationType.h" | 38 #include "core/animation/SVGNumberInterpolationType.h" |
| 40 #include "core/animation/SVGNumberListInterpolationType.h" | 39 #include "core/animation/SVGNumberListInterpolationType.h" |
| 41 #include "core/animation/SVGNumberOptionalNumberInterpolationType.h" | 40 #include "core/animation/SVGNumberOptionalNumberInterpolationType.h" |
| 42 #include "core/animation/SVGPathInterpolationType.h" | 41 #include "core/animation/SVGPathInterpolationType.h" |
| 43 #include "core/animation/SVGPointListInterpolationType.h" | 42 #include "core/animation/SVGPointListInterpolationType.h" |
| 44 #include "core/animation/SVGRectInterpolationType.h" | 43 #include "core/animation/SVGRectInterpolationType.h" |
| 45 #include "core/animation/SVGTransformListInterpolationType.h" | 44 #include "core/animation/SVGTransformListInterpolationType.h" |
| 46 #include "core/animation/SVGValueInterpolationType.h" | 45 #include "core/animation/SVGValueInterpolationType.h" |
| 47 #include "core/animation/VisibilityStyleInterpolation.h" | 46 #include "core/animation/VisibilityStyleInterpolation.h" |
| 48 #include "core/animation/css/CSSAnimations.h" | 47 #include "core/animation/css/CSSAnimations.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 || attribute == SVGNames::markerHeightAttr | 291 || attribute == SVGNames::markerHeightAttr |
| 293 || attribute == SVGNames::markerWidthAttr | 292 || attribute == SVGNames::markerWidthAttr |
| 294 || attribute == SVGNames::rAttr | 293 || attribute == SVGNames::rAttr |
| 295 || attribute == SVGNames::refXAttr | 294 || attribute == SVGNames::refXAttr |
| 296 || attribute == SVGNames::refYAttr | 295 || attribute == SVGNames::refYAttr |
| 297 || attribute == SVGNames::rxAttr | 296 || attribute == SVGNames::rxAttr |
| 298 || attribute == SVGNames::ryAttr | 297 || attribute == SVGNames::ryAttr |
| 299 || attribute == SVGNames::startOffsetAttr | 298 || attribute == SVGNames::startOffsetAttr |
| 300 || attribute == SVGNames::textLengthAttr | 299 || attribute == SVGNames::textLengthAttr |
| 301 || attribute == SVGNames::widthAttr | 300 || attribute == SVGNames::widthAttr |
| 302 || attribute == SVGNames::xAttr | |
| 303 || attribute == SVGNames::x1Attr | 301 || attribute == SVGNames::x1Attr |
| 304 || attribute == SVGNames::x2Attr | 302 || attribute == SVGNames::x2Attr |
| 305 || attribute == SVGNames::y1Attr | 303 || attribute == SVGNames::y1Attr |
| 306 || attribute == SVGNames::y2Attr) { | 304 || attribute == SVGNames::y2Attr) { |
| 307 applicableTypes->append(adoptPtr(new SVGLengthInterpolationType(attr
ibute))); | 305 applicableTypes->append(adoptPtr(new SVGLengthInterpolationType(attr
ibute))); |
| 306 } else if (attribute == SVGNames::dxAttr |
| 307 || attribute == SVGNames::dyAttr) { |
| 308 applicableTypes->append(adoptPtr(new SVGNumberInterpolationType(attr
ibute))); |
| 309 applicableTypes->append(adoptPtr(new SVGLengthListInterpolationType(
attribute))); |
| 310 } else if (attribute == SVGNames::xAttr |
| 311 || attribute == SVGNames::yAttr) { |
| 312 applicableTypes->append(adoptPtr(new SVGLengthInterpolationType(attr
ibute))); |
| 313 applicableTypes->append(adoptPtr(new SVGLengthListInterpolationType(
attribute))); |
| 308 } else if (attribute == SVGNames::amplitudeAttr | 314 } else if (attribute == SVGNames::amplitudeAttr |
| 309 || attribute == SVGNames::azimuthAttr | 315 || attribute == SVGNames::azimuthAttr |
| 310 || attribute == SVGNames::biasAttr | 316 || attribute == SVGNames::biasAttr |
| 311 || attribute == SVGNames::diffuseConstantAttr | 317 || attribute == SVGNames::diffuseConstantAttr |
| 312 || attribute == SVGNames::divisorAttr | 318 || attribute == SVGNames::divisorAttr |
| 313 || attribute == SVGNames::elevationAttr | 319 || attribute == SVGNames::elevationAttr |
| 314 || attribute == SVGNames::exponentAttr | 320 || attribute == SVGNames::exponentAttr |
| 315 || attribute == SVGNames::interceptAttr | 321 || attribute == SVGNames::interceptAttr |
| 316 || attribute == SVGNames::k1Attr | 322 || attribute == SVGNames::k1Attr |
| 317 || attribute == SVGNames::k2Attr | 323 || attribute == SVGNames::k2Attr |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 return adoptPtr(new SVGPropertySpecificKeyframe(offset, easing, String(), Ef
fectModel::CompositeAdd)); | 601 return adoptPtr(new SVGPropertySpecificKeyframe(offset, easing, String(), Ef
fectModel::CompositeAdd)); |
| 596 } | 602 } |
| 597 | 603 |
| 598 namespace { | 604 namespace { |
| 599 | 605 |
| 600 PassRefPtr<Interpolation> createSVGInterpolation(SVGPropertyBase* fromValue, SVG
PropertyBase* toValue, SVGAnimatedPropertyBase* attribute) | 606 PassRefPtr<Interpolation> createSVGInterpolation(SVGPropertyBase* fromValue, SVG
PropertyBase* toValue, SVGAnimatedPropertyBase* attribute) |
| 601 { | 607 { |
| 602 RefPtr<Interpolation> interpolation = nullptr; | 608 RefPtr<Interpolation> interpolation = nullptr; |
| 603 ASSERT(fromValue->type() == toValue->type()); | 609 ASSERT(fromValue->type() == toValue->type()); |
| 604 switch (fromValue->type()) { | 610 switch (fromValue->type()) { |
| 605 case AnimatedLengthList: | |
| 606 interpolation = ListSVGInterpolation<LengthSVGInterpolation>::maybeCreat
e(fromValue, toValue, attribute); | |
| 607 break; | |
| 608 | |
| 609 // Handled by SVGInterpolationTypes. | 611 // Handled by SVGInterpolationTypes. |
| 610 case AnimatedAngle: | 612 case AnimatedAngle: |
| 611 case AnimatedInteger: | 613 case AnimatedInteger: |
| 612 case AnimatedIntegerOptionalInteger: | 614 case AnimatedIntegerOptionalInteger: |
| 613 case AnimatedLength: | 615 case AnimatedLength: |
| 616 case AnimatedLengthList: |
| 614 case AnimatedNumber: | 617 case AnimatedNumber: |
| 615 case AnimatedNumberList: | 618 case AnimatedNumberList: |
| 616 case AnimatedNumberOptionalNumber: | 619 case AnimatedNumberOptionalNumber: |
| 617 case AnimatedPath: | 620 case AnimatedPath: |
| 618 case AnimatedPoints: | 621 case AnimatedPoints: |
| 619 case AnimatedRect: | 622 case AnimatedRect: |
| 620 case AnimatedTransformList: | 623 case AnimatedTransformList: |
| 621 ASSERT_NOT_REACHED(); | 624 ASSERT_NOT_REACHED(); |
| 622 // Fallthrough. | 625 // Fallthrough. |
| 623 | 626 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 646 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); | 649 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); |
| 647 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); | 650 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); |
| 648 | 651 |
| 649 if (!fromValue || !toValue) | 652 if (!fromValue || !toValue) |
| 650 return nullptr; | 653 return nullptr; |
| 651 | 654 |
| 652 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute); | 655 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute); |
| 653 } | 656 } |
| 654 | 657 |
| 655 } // namespace blink | 658 } // namespace blink |
| OLD | NEW |