Beispiel #1
0
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();
}
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());
}