Пример #1
0
bool appendKeyframeWithCustomBezierTimingFunction<TransformAnimationValue, WebTransformKeyframe, WebTransformAnimationCurve>(WebTransformAnimationCurve* curve, double keyTime, const TransformAnimationValue* value, const TransformAnimationValue* lastValue, double x1, double y1, double x2, double y2, const FloatSize& boxSize)
{
    if (causesRotationOfAtLeast180Degrees(value, lastValue))
        return false;

    WebTransformOperations operations = toWebTransformOperations(*value->value(), boxSize);
    if (operations.apply().isInvertible()) {
        curve->add(WebTransformKeyframe(keyTime, operations), x1, y1, x2, y2);
        return true;
    }
    return false;
}
Пример #2
0
bool appendKeyframeWithStandardTimingFunction<TransformAnimationValue, WebTransformKeyframe, WebTransformAnimationCurve>(WebTransformAnimationCurve* curve, double keyTime, const TransformAnimationValue* value, const TransformAnimationValue* lastValue, WebKit::WebAnimationCurve::TimingFunctionType timingFunctionType, const FloatSize& boxSize)
{
    if (causesRotationOfAtLeast180Degrees(value, lastValue))
        return false;

    WebTransformOperations operations = toWebTransformOperations(*value->value(), boxSize);
    if (operations.apply().isInvertible()) {
        curve->add(WebTransformKeyframe(keyTime, operations), timingFunctionType);
        return true;
    }
    return false;
}
Пример #3
0
bool appendKeyframeWithCustomBezierTimingFunction<TransformAnimationValue, WebTransformKeyframe, WebTransformAnimationCurve>(WebTransformAnimationCurve* curve, double keyTime, const TransformAnimationValue* value, const TransformAnimationValue* lastValue, double x1, double y1, double x2, double y2, const FloatSize& boxSize)
{
    bool canBlend = !lastValue;
    WebTransformOperations operations = toWebTransformOperations(*value->value(), boxSize);
    if (!canBlend) {
        WebTransformOperations lastOperations = toWebTransformOperations(*lastValue->value(), boxSize);
        canBlend = lastOperations.canBlendWith(operations);
    }
    if (canBlend) {
        curve->add(WebTransformKeyframe(keyTime, operations), x1, y1, x2, y2);
        return true;
    }
    return false;
}
Пример #4
0
bool appendKeyframeWithStandardTimingFunction<TransformAnimationValue, WebTransformKeyframe, WebTransformAnimationCurve>(WebTransformAnimationCurve* curve, double keyTime, const TransformAnimationValue* value, const TransformAnimationValue* lastValue, WebKit::WebAnimationCurve::TimingFunctionType timingFunctionType, const FloatSize& boxSize)
{
    bool canBlend = !lastValue;
    WebTransformOperations operations = toWebTransformOperations(*value->value(), boxSize);
    if (!canBlend) {
        WebTransformOperations lastOperations = toWebTransformOperations(*lastValue->value(), boxSize);
        canBlend = lastOperations.canBlendWith(operations);
    }
    if (canBlend) {
        curve->add(WebTransformKeyframe(keyTime, operations), timingFunctionType);
        return true;
    }
    return false;
}