Chromium Code Reviews| Index: Source/core/animation/AnimatableSVGPaint.cpp |
| diff --git a/Source/core/animation/AnimatableVisibility.cpp b/Source/core/animation/AnimatableSVGPaint.cpp |
| similarity index 64% |
| copy from Source/core/animation/AnimatableVisibility.cpp |
| copy to Source/core/animation/AnimatableSVGPaint.cpp |
| index 2cfc097ada77aa7750f4157b2240c07ba9ce1b0f..e28d802610c3626482a9d42ffe4357206bd7c964 100644 |
| --- a/Source/core/animation/AnimatableVisibility.cpp |
| +++ b/Source/core/animation/AnimatableSVGPaint.cpp |
| @@ -29,21 +29,24 @@ |
| */ |
| #include "config.h" |
| -#include "core/animation/AnimatableVisibility.h" |
| +#include "core/animation/AnimatableSVGPaint.h" |
| namespace WebCore { |
| -PassRefPtr<AnimatableValue> AnimatableVisibility::interpolateTo(const AnimatableValue* value, double fraction) const |
| +PassRefPtr<AnimatableValue> AnimatableSVGPaint::interpolateTo(const AnimatableValue* value, double fraction) const |
| { |
| - EVisibility from = m_visibility; |
| - EVisibility to = toAnimatableVisibility(value)->m_visibility; |
| - if (from != VISIBLE && to != VISIBLE) |
| + const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value); |
| + if (paintType() != SVGPaint::SVG_PAINTTYPE_RGBCOLOR || svgPaint->paintType() != SVGPaint::SVG_PAINTTYPE_RGBCOLOR) |
| return defaultInterpolateTo(this, value, fraction); |
| - if (fraction <= 0) |
| - return takeConstRef(this); |
| - if (fraction >= 1) |
| - return takeConstRef(value); |
| - return takeConstRef(from == VISIBLE ? this : value); |
| + return AnimatableSVGPaint::create(this->paintType(), this->m_color.interpolateTo(svgPaint->m_color, fraction), this->uri()); |
|
Steve Block
2013/10/03 02:37:53
If you test for (paintType() == SVG_PAINTTYPE_RGBC
dstockwell
2013/10/03 05:01:07
Done.
|
| } |
| -} // namespace WebCore |
| +PassRefPtr<AnimatableValue> AnimatableSVGPaint::addWith(const AnimatableValue* value) const |
| +{ |
| + const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value); |
| + if (paintType() != SVGPaint::SVG_PAINTTYPE_RGBCOLOR || svgPaint->paintType() != SVGPaint::SVG_PAINTTYPE_RGBCOLOR) |
| + return defaultAddWith(this, value); |
| + return AnimatableSVGPaint::create(this->paintType(), this->m_color.addWith(svgPaint->m_color), this->uri()); |
|
Steve Block
2013/10/03 02:37:53
Similar comments to above.
dstockwell
2013/10/03 05:01:07
Done.
|
| +} |
| + |
| +} |