| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 const TimingFunction* keyframeTimingFunction = 0; | 398 const TimingFunction* keyframeTimingFunction = 0; |
| 399 if (i < keyframes.size() - 1) { // Ignore timing function of last frame. | 399 if (i < keyframes.size() - 1) { // Ignore timing function of last frame. |
| 400 if (reverse) { | 400 if (reverse) { |
| 401 reversedTimingFunction = CompositorAnimationsTimingFunctionRever
ser::reverse(keyframes[i + 1]->easing()); | 401 reversedTimingFunction = CompositorAnimationsTimingFunctionRever
ser::reverse(keyframes[i + 1]->easing()); |
| 402 keyframeTimingFunction = reversedTimingFunction.get(); | 402 keyframeTimingFunction = reversedTimingFunction.get(); |
| 403 } else { | 403 } else { |
| 404 keyframeTimingFunction = keyframes[i]->easing(); | 404 keyframeTimingFunction = keyframes[i]->easing(); |
| 405 } | 405 } |
| 406 } | 406 } |
| 407 | 407 |
| 408 ASSERT(!keyframes[i]->value()->dependsOnUnderlyingValue()); | 408 const AnimatableValue* value = keyframes[i]->value(); |
| 409 RefPtr<AnimatableValue> value = keyframes[i]->value()->compositeOnto(0); | |
| 410 | 409 |
| 411 switch (curve.type()) { | 410 switch (curve.type()) { |
| 412 case blink::WebAnimationCurve::AnimationCurveTypeFilter: { | 411 case blink::WebAnimationCurve::AnimationCurveTypeFilter: { |
| 413 OwnPtr<blink::WebFilterOperations> ops = adoptPtr(blink::Platform::c
urrent()->compositorSupport()->createFilterOperations()); | 412 OwnPtr<blink::WebFilterOperations> ops = adoptPtr(blink::Platform::c
urrent()->compositorSupport()->createFilterOperations()); |
| 414 bool converted = toWebFilterOperations(toAnimatableFilterOperations(
value.get())->operations(), ops.get()); | 413 bool converted = toWebFilterOperations(toAnimatableFilterOperations(
value)->operations(), ops.get()); |
| 415 ASSERT_UNUSED(converted, converted); | 414 ASSERT_UNUSED(converted, converted); |
| 416 | 415 |
| 417 blink::WebFilterKeyframe filterKeyframe(keyframes[i]->offset(), ops.
release()); | 416 blink::WebFilterKeyframe filterKeyframe(keyframes[i]->offset(), ops.
release()); |
| 418 blink::WebFilterAnimationCurve* filterCurve = static_cast<blink::Web
FilterAnimationCurve*>(&curve); | 417 blink::WebFilterAnimationCurve* filterCurve = static_cast<blink::Web
FilterAnimationCurve*>(&curve); |
| 419 addKeyframeWithTimingFunction(*filterCurve, filterKeyframe, keyframe
TimingFunction); | 418 addKeyframeWithTimingFunction(*filterCurve, filterKeyframe, keyframe
TimingFunction); |
| 420 break; | 419 break; |
| 421 } | 420 } |
| 422 case blink::WebAnimationCurve::AnimationCurveTypeFloat: { | 421 case blink::WebAnimationCurve::AnimationCurveTypeFloat: { |
| 423 blink::WebFloatKeyframe floatKeyframe(keyframes[i]->offset(), toAnim
atableDouble(value.get())->toDouble()); | 422 blink::WebFloatKeyframe floatKeyframe(keyframes[i]->offset(), toAnim
atableDouble(value)->toDouble()); |
| 424 blink::WebFloatAnimationCurve* floatCurve = static_cast<blink::WebFl
oatAnimationCurve*>(&curve); | 423 blink::WebFloatAnimationCurve* floatCurve = static_cast<blink::WebFl
oatAnimationCurve*>(&curve); |
| 425 addKeyframeWithTimingFunction(*floatCurve, floatKeyframe, keyframeTi
mingFunction); | 424 addKeyframeWithTimingFunction(*floatCurve, floatKeyframe, keyframeTi
mingFunction); |
| 426 break; | 425 break; |
| 427 } | 426 } |
| 428 case blink::WebAnimationCurve::AnimationCurveTypeTransform: { | 427 case blink::WebAnimationCurve::AnimationCurveTypeTransform: { |
| 429 OwnPtr<blink::WebTransformOperations> ops = adoptPtr(blink::Platform
::current()->compositorSupport()->createTransformOperations()); | 428 OwnPtr<blink::WebTransformOperations> ops = adoptPtr(blink::Platform
::current()->compositorSupport()->createTransformOperations()); |
| 430 toWebTransformOperations(toAnimatableTransform(value.get())->transfo
rmOperations(), ops.get()); | 429 toWebTransformOperations(toAnimatableTransform(value)->transformOper
ations(), ops.get()); |
| 431 | 430 |
| 432 blink::WebTransformKeyframe transformKeyframe(keyframes[i]->offset()
, ops.release()); | 431 blink::WebTransformKeyframe transformKeyframe(keyframes[i]->offset()
, ops.release()); |
| 433 blink::WebTransformAnimationCurve* transformCurve = static_cast<blin
k::WebTransformAnimationCurve*>(&curve); | 432 blink::WebTransformAnimationCurve* transformCurve = static_cast<blin
k::WebTransformAnimationCurve*>(&curve); |
| 434 addKeyframeWithTimingFunction(*transformCurve, transformKeyframe, ke
yframeTimingFunction); | 433 addKeyframeWithTimingFunction(*transformCurve, transformKeyframe, ke
yframeTimingFunction); |
| 435 break; | 434 break; |
| 436 } | 435 } |
| 437 default: | 436 default: |
| 438 ASSERT_NOT_REACHED(); | 437 ASSERT_NOT_REACHED(); |
| 439 } | 438 } |
| 440 } | 439 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 animation->setIterations(compositorTiming.adjustedIterationCount); | 493 animation->setIterations(compositorTiming.adjustedIterationCount); |
| 495 animation->setTimeOffset(compositorTiming.scaledTimeOffset); | 494 animation->setTimeOffset(compositorTiming.scaledTimeOffset); |
| 496 animation->setAlternatesDirection(compositorTiming.alternate); | 495 animation->setAlternatesDirection(compositorTiming.alternate); |
| 497 | 496 |
| 498 animations.append(animation.release()); | 497 animations.append(animation.release()); |
| 499 } | 498 } |
| 500 ASSERT(!animations.isEmpty()); | 499 ASSERT(!animations.isEmpty()); |
| 501 } | 500 } |
| 502 | 501 |
| 503 } // namespace WebCore | 502 } // namespace WebCore |
| OLD | NEW |