Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1290)

Unified Diff: third_party/WebKit/Source/core/animation/StringKeyframe.cpp

Issue 1607633003: Code cleanup: Remove SVGInterpolation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused assertion variable to make release compile Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/animation/StringKeyframe.cpp
diff --git a/third_party/WebKit/Source/core/animation/StringKeyframe.cpp b/third_party/WebKit/Source/core/animation/StringKeyframe.cpp
index 990b7f61ee7850ca975a5396e02381f75dc7bcab..d2a373e5297764f2427220957f188f6217714dc7 100644
--- a/third_party/WebKit/Source/core/animation/StringKeyframe.cpp
+++ b/third_party/WebKit/Source/core/animation/StringKeyframe.cpp
@@ -20,7 +20,6 @@
#include "core/animation/CSSVisibilityInterpolationType.h"
#include "core/animation/CompositorAnimations.h"
#include "core/animation/ConstantStyleInterpolation.h"
-#include "core/animation/DefaultSVGInterpolation.h"
#include "core/animation/DeferredLegacyStyleInterpolation.h"
#include "core/animation/DoubleStyleInterpolation.h"
#include "core/animation/FilterStyleInterpolation.h"
@@ -625,58 +624,11 @@ PassOwnPtr<Keyframe::PropertySpecificKeyframe> SVGPropertySpecificKeyframe::neut
return adoptPtr(new SVGPropertySpecificKeyframe(offset, easing, String(), EffectModel::CompositeAdd));
}
-namespace {
-
-PassRefPtr<Interpolation> createSVGInterpolation(SVGPropertyBase* fromValue, SVGPropertyBase* toValue, SVGAnimatedPropertyBase* attribute)
-{
- RefPtr<Interpolation> interpolation = nullptr;
- ASSERT(fromValue->type() == toValue->type());
- switch (fromValue->type()) {
- // Handled by SVGInterpolationTypes.
- case AnimatedAngle:
- case AnimatedInteger:
- case AnimatedIntegerOptionalInteger:
- case AnimatedLength:
- case AnimatedLengthList:
- case AnimatedNumber:
- case AnimatedNumberList:
- case AnimatedNumberOptionalNumber:
- case AnimatedPath:
- case AnimatedPoints:
- case AnimatedRect:
- case AnimatedTransformList:
- ASSERT_NOT_REACHED();
- // Fallthrough.
-
- // TODO(ericwilligers): Support more animation types.
- default:
- break;
- }
- if (interpolation)
- return interpolation.release();
-
- return DefaultSVGInterpolation::create(fromValue, toValue, attribute);
-}
-
-} // namespace
-
-PassRefPtr<Interpolation> SVGPropertySpecificKeyframe::maybeCreateInterpolation(PropertyHandle propertyHandle, Keyframe::PropertySpecificKeyframe& end, Element* element, const ComputedStyle* baseStyle) const
+PassRefPtr<Interpolation> SVGPropertySpecificKeyframe::maybeCreateInterpolation(PropertyHandle propertyHandle, Keyframe::PropertySpecificKeyframe& end, Element*, const ComputedStyle*) const
{
const InterpolationTypes* applicableTypes = applicableTypesForProperty(propertyHandle);
- if (applicableTypes)
- return InvalidatableInterpolation::create(propertyHandle, *applicableTypes, *this, end);
-
- ASSERT(element);
- SVGAnimatedPropertyBase* attribute = toSVGElement(element)->propertyFromAttribute(propertyHandle.svgAttribute());
- ASSERT(attribute);
-
- RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase()->cloneForAnimation(m_value);
- RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()->cloneForAnimation(toSVGPropertySpecificKeyframe(end).value());
-
- if (!fromValue || !toValue)
- return nullptr;
-
- return createSVGInterpolation(fromValue.get(), toValue.get(), attribute);
+ ASSERT(applicableTypes);
+ return InvalidatableInterpolation::create(propertyHandle, *applicableTypes, *this, end);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/animation/SampledEffect.cpp ('k') | third_party/WebKit/Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698