| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 // FIXME: This relies on StringKeyframes being eagerly evaluated, which
will | 610 // FIXME: This relies on StringKeyframes being eagerly evaluated, which
will |
| 611 // not happen eventually. Instead we should extract the CSSValue here | 611 // not happen eventually. Instead we should extract the CSSValue here |
| 612 // and convert using another set of toAnimatableXXXOperations functions. | 612 // and convert using another set of toAnimatableXXXOperations functions. |
| 613 const AnimatableValue* value = keyframe->getAnimatableValue().get(); | 613 const AnimatableValue* value = keyframe->getAnimatableValue().get(); |
| 614 | 614 |
| 615 switch (curve.type()) { | 615 switch (curve.type()) { |
| 616 case CompositorAnimationCurve::AnimationCurveTypeFilter: { | 616 case CompositorAnimationCurve::AnimationCurveTypeFilter: { |
| 617 OwnPtr<CompositorFilterOperations> ops = adoptPtr(CompositorFactory:
:current().createFilterOperations()); | 617 OwnPtr<CompositorFilterOperations> ops = adoptPtr(CompositorFactory:
:current().createFilterOperations()); |
| 618 toCompositorFilterOperations(toAnimatableFilterOperations(value)->op
erations(), ops.get()); | 618 toCompositorFilterOperations(toAnimatableFilterOperations(value)->op
erations(), ops.get()); |
| 619 | 619 |
| 620 CompositorFilterKeyframe filterKeyframe(keyframe->offset(), ops.rele
ase()); | 620 CompositorFilterKeyframe filterKeyframe(keyframe->offset(), std::mov
e(ops)); |
| 621 CompositorFilterAnimationCurve* filterCurve = static_cast<Compositor
FilterAnimationCurve*>(&curve); | 621 CompositorFilterAnimationCurve* filterCurve = static_cast<Compositor
FilterAnimationCurve*>(&curve); |
| 622 addKeyframeWithTimingFunction(*filterCurve, filterKeyframe, keyframe
TimingFunction); | 622 addKeyframeWithTimingFunction(*filterCurve, filterKeyframe, keyframe
TimingFunction); |
| 623 break; | 623 break; |
| 624 } | 624 } |
| 625 case CompositorAnimationCurve::AnimationCurveTypeFloat: { | 625 case CompositorAnimationCurve::AnimationCurveTypeFloat: { |
| 626 CompositorFloatKeyframe floatKeyframe(keyframe->offset(), toAnimatab
leDouble(value)->toDouble()); | 626 CompositorFloatKeyframe floatKeyframe(keyframe->offset(), toAnimatab
leDouble(value)->toDouble()); |
| 627 CompositorFloatAnimationCurve* floatCurve = static_cast<CompositorFl
oatAnimationCurve*>(&curve); | 627 CompositorFloatAnimationCurve* floatCurve = static_cast<CompositorFl
oatAnimationCurve*>(&curve); |
| 628 addKeyframeWithTimingFunction(*floatCurve, floatKeyframe, keyframeTi
mingFunction); | 628 addKeyframeWithTimingFunction(*floatCurve, floatKeyframe, keyframeTi
mingFunction); |
| 629 break; | 629 break; |
| 630 } | 630 } |
| 631 case CompositorAnimationCurve::AnimationCurveTypeTransform: { | 631 case CompositorAnimationCurve::AnimationCurveTypeTransform: { |
| 632 OwnPtr<CompositorTransformOperations> ops = adoptPtr(CompositorFacto
ry::current().createTransformOperations()); | 632 OwnPtr<CompositorTransformOperations> ops = adoptPtr(CompositorFacto
ry::current().createTransformOperations()); |
| 633 toCompositorTransformOperations(toAnimatableTransform(value)->transf
ormOperations(), ops.get()); | 633 toCompositorTransformOperations(toAnimatableTransform(value)->transf
ormOperations(), ops.get()); |
| 634 | 634 |
| 635 CompositorTransformKeyframe transformKeyframe(keyframe->offset(), op
s.release()); | 635 CompositorTransformKeyframe transformKeyframe(keyframe->offset(), st
d::move(ops)); |
| 636 CompositorTransformAnimationCurve* transformCurve = static_cast<Comp
ositorTransformAnimationCurve*>(&curve); | 636 CompositorTransformAnimationCurve* transformCurve = static_cast<Comp
ositorTransformAnimationCurve*>(&curve); |
| 637 addKeyframeWithTimingFunction(*transformCurve, transformKeyframe, ke
yframeTimingFunction); | 637 addKeyframeWithTimingFunction(*transformCurve, transformKeyframe, ke
yframeTimingFunction); |
| 638 break; | 638 break; |
| 639 } | 639 } |
| 640 default: | 640 default: |
| 641 ASSERT_NOT_REACHED(); | 641 ASSERT_NOT_REACHED(); |
| 642 } | 642 } |
| 643 } | 643 } |
| 644 } | 644 } |
| 645 | 645 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 break; | 737 break; |
| 738 case Timing::FillModeBackwards: | 738 case Timing::FillModeBackwards: |
| 739 animation->setFillMode(CompositorAnimation::FillModeBackwards); | 739 animation->setFillMode(CompositorAnimation::FillModeBackwards); |
| 740 break; | 740 break; |
| 741 case Timing::FillModeBoth: | 741 case Timing::FillModeBoth: |
| 742 animation->setFillMode(CompositorAnimation::FillModeBoth); | 742 animation->setFillMode(CompositorAnimation::FillModeBoth); |
| 743 break; | 743 break; |
| 744 default: | 744 default: |
| 745 ASSERT_NOT_REACHED(); | 745 ASSERT_NOT_REACHED(); |
| 746 } | 746 } |
| 747 animations.append(animation.release()); | 747 animations.append(std::move(animation)); |
| 748 } | 748 } |
| 749 ASSERT(!animations.isEmpty()); | 749 ASSERT(!animations.isEmpty()); |
| 750 } | 750 } |
| 751 | 751 |
| 752 } // namespace blink | 752 } // namespace blink |
| OLD | NEW |