This source file includes following definitions.
- usesDefaultInterpolationWith
- interpolateTo
- equalTo
#include "config.h"
#include "core/animation/AnimatableClipPathOperation.h"
namespace WebCore {
bool AnimatableClipPathOperation::usesDefaultInterpolationWith(const AnimatableValue* value) const
{
const AnimatableClipPathOperation* toOperation = toAnimatableClipPathOperation(value);
if (m_operation->type() != ClipPathOperation::SHAPE || toOperation->m_operation->type() != ClipPathOperation::SHAPE)
return true;
const BasicShape* fromShape = toShapeClipPathOperation(clipPathOperation())->basicShape();
const BasicShape* toShape = toShapeClipPathOperation(toOperation->clipPathOperation())->basicShape();
return !fromShape->canBlend(toShape);
}
PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableClipPathOperation::interpolateTo(const AnimatableValue* value, double fraction) const
{
if (usesDefaultInterpolationWith(value))
return defaultInterpolateTo(this, value, fraction);
const AnimatableClipPathOperation* toOperation = toAnimatableClipPathOperation(value);
const BasicShape* fromShape = toShapeClipPathOperation(clipPathOperation())->basicShape();
const BasicShape* toShape = toShapeClipPathOperation(toOperation->clipPathOperation())->basicShape();
return AnimatableClipPathOperation::create(ShapeClipPathOperation::create(toShape->blend(fromShape, fraction)).get());
}
bool AnimatableClipPathOperation::equalTo(const AnimatableValue* value) const
{
const ClipPathOperation* operation = toAnimatableClipPathOperation(value)->m_operation.get();
return m_operation == operation || (m_operation && operation && *m_operation == *operation);
}
}