Share single calculateFromToValues/calculateFromByValues between all SVGAnimatedTypeA...
authorzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Apr 2012 10:05:06 +0000 (10:05 +0000)
committerzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Apr 2012 10:05:06 +0000 (10:05 +0000)
commit896a4b884eb3ba4cb494421b07b9f42dfd037d91
tree5292106ffc3054c9318c87b4cfbaf402aa94b8e3
parent63446c16336e9974205ab481fa21b3b9207550c5
Share single calculateFromToValues/calculateFromByValues between all SVGAnimatedTypeAnimators
https://bugs.webkit.org/show_bug.cgi?id=84832

Reviewed by Antti Koivisto.

calculateFromAndToValues / calculateFromAndByValues don't need to be spread across all SVGAnimatedTypeAnimators.
Centralize these new implementations in SVGAnimatedTypeAnimator.h. Refactored addAnimatedTypes() from constructFromAndByValues.

calculateFromAndToValues:
    from = constructFromString(fromString)
    to = constructFromString(toString)

calculateFromAndByValues:
    from = constructFromString(fromString)
    to = constructFromString(byString)
    addAnimatedTypes(from, to)

Doesn't affect any tests, just refactors code.

* svg/SVGAnimateElement.cpp:
(WebCore::SVGAnimateElement::calculateFromAndToValues):
(WebCore::SVGAnimateElement::calculateFromAndByValues):
* svg/SVGAnimatedAngle.cpp:
(WebCore::SVGAnimatedAngleAnimator::addAnimatedTypes):
* svg/SVGAnimatedAngle.h:
(SVGAnimatedAngleAnimator):
* svg/SVGAnimatedBoolean.cpp:
(WebCore::SVGAnimatedBooleanAnimator::addAnimatedTypes):
* svg/SVGAnimatedBoolean.h:
(SVGAnimatedBooleanAnimator):
* svg/SVGAnimatedColor.cpp:
(WebCore::SVGAnimatedColorAnimator::addAnimatedTypes):
* svg/SVGAnimatedColor.h:
(SVGAnimatedColorAnimator):
* svg/SVGAnimatedEnumeration.cpp:
(WebCore::SVGAnimatedEnumerationAnimator::addAnimatedTypes):
* svg/SVGAnimatedEnumeration.h:
(SVGAnimatedEnumerationAnimator):
* svg/SVGAnimatedInteger.cpp:
(WebCore::SVGAnimatedIntegerAnimator::addAnimatedTypes):
* svg/SVGAnimatedInteger.h:
(SVGAnimatedIntegerAnimator):
* svg/SVGAnimatedIntegerOptionalInteger.cpp:
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::addAnimatedTypes):
* svg/SVGAnimatedIntegerOptionalInteger.h:
(SVGAnimatedIntegerOptionalIntegerAnimator):
* svg/SVGAnimatedLength.cpp:
(WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
* svg/SVGAnimatedLength.h:
(SVGAnimatedLengthAnimator):
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
* svg/SVGAnimatedLengthList.h:
(SVGAnimatedLengthListAnimator):
* svg/SVGAnimatedNumber.cpp:
(WebCore::SVGAnimatedNumberAnimator::addAnimatedTypes):
* svg/SVGAnimatedNumber.h:
(SVGAnimatedNumberAnimator):
* svg/SVGAnimatedNumberList.cpp:
(WebCore::SVGAnimatedNumberListAnimator::addAnimatedTypes):
* svg/SVGAnimatedNumberList.h:
(SVGAnimatedNumberListAnimator):
* svg/SVGAnimatedNumberOptionalNumber.cpp:
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::addAnimatedTypes):
* svg/SVGAnimatedNumberOptionalNumber.h:
(SVGAnimatedNumberOptionalNumberAnimator):
* svg/SVGAnimatedPath.cpp:
(WebCore::SVGAnimatedPathAnimator::constructFromString):
(WebCore::SVGAnimatedPathAnimator::addAnimatedTypes):
* svg/SVGAnimatedPath.h:
(SVGAnimatedPathAnimator):
* svg/SVGAnimatedPointList.cpp:
(WebCore::SVGAnimatedPointListAnimator::addAnimatedTypes):
* svg/SVGAnimatedPointList.h:
(SVGAnimatedPointListAnimator):
* svg/SVGAnimatedPreserveAspectRatio.cpp:
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::addAnimatedTypes):
* svg/SVGAnimatedPreserveAspectRatio.h:
(SVGAnimatedPreserveAspectRatioAnimator):
* svg/SVGAnimatedRect.cpp:
(WebCore::SVGAnimatedRectAnimator::addAnimatedTypes):
* svg/SVGAnimatedRect.h:
(SVGAnimatedRectAnimator):
* svg/SVGAnimatedString.cpp:
(WebCore::SVGAnimatedStringAnimator::addAnimatedTypes):
* svg/SVGAnimatedString.h:
(SVGAnimatedStringAnimator):
* svg/SVGAnimatedTransformList.cpp:
(WebCore::SVGAnimatedTransformListAnimator::SVGAnimatedTransformListAnimator):
(WebCore::SVGAnimatedTransformListAnimator::constructFromString):
(WebCore::SVGAnimatedTransformListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedTransformListAnimator::calculateDistance):
* svg/SVGAnimatedTransformList.h:
(SVGAnimatedTransformListAnimator):
* svg/SVGAnimatedTypeAnimator.h:
(SVGAnimatedTypeAnimator):
(WebCore::SVGAnimatedTypeAnimator::calculateFromAndToValues):
(WebCore::SVGAnimatedTypeAnimator::calculateFromAndByValues):
(WebCore::SVGAnimatedTypeAnimator::setContextElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115178 268f45cc-cd09-0410-ab3c-d52691b4dbfc
37 files changed:
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGAnimateElement.cpp
Source/WebCore/svg/SVGAnimatedAngle.cpp
Source/WebCore/svg/SVGAnimatedAngle.h
Source/WebCore/svg/SVGAnimatedBoolean.cpp
Source/WebCore/svg/SVGAnimatedBoolean.h
Source/WebCore/svg/SVGAnimatedColor.cpp
Source/WebCore/svg/SVGAnimatedColor.h
Source/WebCore/svg/SVGAnimatedEnumeration.cpp
Source/WebCore/svg/SVGAnimatedEnumeration.h
Source/WebCore/svg/SVGAnimatedInteger.cpp
Source/WebCore/svg/SVGAnimatedInteger.h
Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.cpp
Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.h
Source/WebCore/svg/SVGAnimatedLength.cpp
Source/WebCore/svg/SVGAnimatedLength.h
Source/WebCore/svg/SVGAnimatedLengthList.cpp
Source/WebCore/svg/SVGAnimatedLengthList.h
Source/WebCore/svg/SVGAnimatedNumber.cpp
Source/WebCore/svg/SVGAnimatedNumber.h
Source/WebCore/svg/SVGAnimatedNumberList.cpp
Source/WebCore/svg/SVGAnimatedNumberList.h
Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.cpp
Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.h
Source/WebCore/svg/SVGAnimatedPath.cpp
Source/WebCore/svg/SVGAnimatedPath.h
Source/WebCore/svg/SVGAnimatedPointList.cpp
Source/WebCore/svg/SVGAnimatedPointList.h
Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp
Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.h
Source/WebCore/svg/SVGAnimatedRect.cpp
Source/WebCore/svg/SVGAnimatedRect.h
Source/WebCore/svg/SVGAnimatedString.cpp
Source/WebCore/svg/SVGAnimatedString.h
Source/WebCore/svg/SVGAnimatedTransformList.cpp
Source/WebCore/svg/SVGAnimatedTransformList.h
Source/WebCore/svg/SVGAnimatedTypeAnimator.h