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

Unified Diff: third_party/WebKit/Source/core/animation/animatable/AnimatableSVGPaint.cpp

Issue 2750293003: Delete unused AnimatableValue code (Closed)
Patch Set: Fix unit tests Created 3 years, 9 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/animatable/AnimatableSVGPaint.cpp
diff --git a/third_party/WebKit/Source/core/animation/animatable/AnimatableSVGPaint.cpp b/third_party/WebKit/Source/core/animation/animatable/AnimatableSVGPaint.cpp
index 3082335683bc844c37479f69e5996e8e7b64be34..b95dbd12150e77b0e544d3de06f5e7691891d1e0 100644
--- a/third_party/WebKit/Source/core/animation/animatable/AnimatableSVGPaint.cpp
+++ b/third_party/WebKit/Source/core/animation/animatable/AnimatableSVGPaint.cpp
@@ -32,39 +32,12 @@
namespace blink {
-bool AnimatableSVGPaint::usesDefaultInterpolationWith(
- const AnimatableValue* value) const {
- const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value);
- return (paintType() != SVG_PAINTTYPE_RGBCOLOR ||
- svgPaint->paintType() != SVG_PAINTTYPE_RGBCOLOR) &&
- (visitedLinkPaintType() != SVG_PAINTTYPE_RGBCOLOR ||
- svgPaint->visitedLinkPaintType() != SVG_PAINTTYPE_RGBCOLOR);
-}
-
-PassRefPtr<AnimatableValue> AnimatableSVGPaint::interpolateTo(
- const AnimatableValue* value,
- double fraction) const {
- if (usesDefaultInterpolationWith(value))
- return defaultInterpolateTo(this, value, fraction);
-
- const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value);
- RefPtr<AnimatableColor> color =
- toAnimatableColor(AnimatableValue::interpolate(
- m_color.get(), svgPaint->m_color.get(), fraction)
- .get());
- if (fraction < 0.5)
- return create(paintType(), visitedLinkPaintType(), color, uri(),
- visitedLinkURI());
- return create(svgPaint->paintType(), svgPaint->visitedLinkPaintType(), color,
- svgPaint->uri(), svgPaint->visitedLinkURI());
-}
-
bool AnimatableSVGPaint::equalTo(const AnimatableValue* value) const {
const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value);
- return paintType() == svgPaint->paintType() &&
- visitedLinkPaintType() == svgPaint->visitedLinkPaintType() &&
- getColor() == svgPaint->getColor() && uri() == svgPaint->uri() &&
- visitedLinkURI() == svgPaint->visitedLinkURI();
+ return m_type == svgPaint->m_type &&
+ m_visitedLinkType == svgPaint->m_visitedLinkType &&
+ m_color->equals(svgPaint->m_color.get()) && m_uri == svgPaint->m_uri &&
+ m_visitedLinkURI == svgPaint->m_visitedLinkURI;
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698