This source file includes following definitions.
- usesDefaultInterpolationWith
- interpolateTo
- addWith
- equalTo
#include "config.h"
#include "core/animation/AnimatableSVGPaint.h"
namespace WebCore {
bool AnimatableSVGPaint::usesDefaultInterpolationWith(const AnimatableValue* value) const
{
const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value);
return paintType() != SVGPaint::SVG_PAINTTYPE_RGBCOLOR || svgPaint->paintType() != SVGPaint::SVG_PAINTTYPE_RGBCOLOR;
}
PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableSVGPaint::interpolateTo(const AnimatableValue* value, double fraction) const
{
const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value);
if (paintType() == SVGPaint::SVG_PAINTTYPE_RGBCOLOR && svgPaint->paintType() == SVGPaint::SVG_PAINTTYPE_RGBCOLOR) {
ASSERT(uri().isNull());
return AnimatableSVGPaint::create(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, m_color.interpolateTo(svgPaint->m_color, fraction), String());
}
return defaultInterpolateTo(this, value, fraction);
}
PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableSVGPaint::addWith(const AnimatableValue* value) const
{
const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value);
if (paintType() != SVGPaint::SVG_PAINTTYPE_RGBCOLOR || svgPaint->paintType() != SVGPaint::SVG_PAINTTYPE_RGBCOLOR) {
ASSERT(uri().isNull());
return AnimatableSVGPaint::create(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, m_color.addWith(svgPaint->m_color), String());
}
return defaultAddWith(this, value);
}
bool AnimatableSVGPaint::equalTo(const AnimatableValue* value) const
{
const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value);
return paintType() == svgPaint->paintType()
&& color() == svgPaint->color()
&& uri() == svgPaint->uri();
}
}