예제 #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();
}
예제 #2
0
bool AnimatableSVGPaint::equalTo(const AnimatableValue* value) const
{
    const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value);
    return paintType() == svgPaint->paintType()
        && color() == svgPaint->color()
        && uri() == svgPaint->uri();
}
예제 #3
0
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);
}
예제 #4
0
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);
}
예제 #5
0
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);
}
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());
}