Пример #1
0
PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableLengthSize::interpolateTo(const AnimatableValue* value, double fraction) const
{
    const AnimatableLengthSize* lengthSize = toAnimatableLengthSize(value);
    return AnimatableLengthSize::create(
        AnimatableValue::interpolate(this->width(), lengthSize->width(), fraction),
        AnimatableValue::interpolate(this->height(), lengthSize->height(), fraction));
}
Пример #2
0
PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableLengthSize::addWith(const AnimatableValue* value) const
{
    const AnimatableLengthSize* lengthSize = toAnimatableLengthSize(value);
    return AnimatableLengthSize::create(
        AnimatableValue::add(this->width(), lengthSize->width()),
        AnimatableValue::add(this->height(), lengthSize->height()));
}
void PrintTo(const AnimatableValue& animValue, ::std::ostream* os)
{
    if (animValue.isClipPathOperation())
        PrintTo(*(toAnimatableClipPathOperation(&animValue)), os);
    else if (animValue.isColor())
        PrintTo(*(toAnimatableColor(&animValue)), os);
    else if (animValue.isDouble())
        PrintTo(*(toAnimatableDouble(&animValue)), os);
    else if (animValue.isImage())
        PrintTo(*(toAnimatableImage(&animValue)), os);
    else if (animValue.isLength())
        PrintTo(*(toAnimatableLength(&animValue)), os);
    else if (animValue.isLengthBox())
        PrintTo(*(toAnimatableLengthBox(&animValue)), os);
    else if (animValue.isLengthPoint())
        PrintTo(*(toAnimatableLengthPoint(&animValue)), os);
    else if (animValue.isLengthSize())
        PrintTo(*(toAnimatableLengthSize(&animValue)), os);
    else if (animValue.isNeutral())
        PrintTo(*(static_cast<const AnimatableNeutral*>(&animValue)), os);
    else if (animValue.isRepeatable())
        PrintTo(*(toAnimatableRepeatable(&animValue)), os);
    else if (animValue.isSVGLength())
        PrintTo(*(toAnimatableSVGLength(&animValue)), os);
    else if (animValue.isSVGPaint())
        PrintTo(*(toAnimatableSVGPaint(&animValue)), os);
    else if (animValue.isShapeValue())
        PrintTo(*(toAnimatableShapeValue(&animValue)), os);
    else if (animValue.isStrokeDasharrayList())
        PrintTo(*(toAnimatableStrokeDasharrayList(&animValue)), os);
    else if (animValue.isTransform())
        PrintTo(*(toAnimatableTransform(&animValue)), os);
    else if (animValue.isUnknown())
        PrintTo(*(toAnimatableUnknown(&animValue)), os);
    else if (animValue.isVisibility())
        PrintTo(*(toAnimatableVisibility(&animValue)), os);
    else
        *os << "Unknown AnimatableValue - update ifelse chain in AnimatableValueTestHelper.h";
}
Пример #4
0
bool AnimatableLengthSize::equalTo(const AnimatableValue* value) const
{
    const AnimatableLengthSize* lengthSize = toAnimatableLengthSize(value);
    return width()->equals(lengthSize->width()) && height()->equals(lengthSize->height());
}