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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 CompositorTiming compositorTiming; | 671 CompositorTiming compositorTiming; |
672 bool timingValid = convertTimingForCompositor(timing, timeOffset, compositor
Timing, animationPlaybackRate); | 672 bool timingValid = convertTimingForCompositor(timing, timeOffset, compositor
Timing, animationPlaybackRate); |
673 ASSERT_UNUSED(timingValid, timingValid); | 673 ASSERT_UNUSED(timingValid, timingValid); |
674 | 674 |
675 PropertyHandleSet properties = effect.properties(); | 675 PropertyHandleSet properties = effect.properties(); |
676 ASSERT(!properties.isEmpty()); | 676 ASSERT(!properties.isEmpty()); |
677 for (const auto& property : properties) { | 677 for (const auto& property : properties) { |
678 PropertySpecificKeyframeVector values; | 678 PropertySpecificKeyframeVector values; |
679 getKeyframeValuesForProperty(&effect, property, compositorTiming.scaledD
uration, values); | 679 getKeyframeValuesForProperty(&effect, property, compositorTiming.scaledD
uration, values); |
680 | 680 |
681 CompositorAnimation::TargetProperty targetProperty; | 681 CompositorTargetProperty::Type targetProperty; |
682 OwnPtr<CompositorAnimationCurve> curve; | 682 OwnPtr<CompositorAnimationCurve> curve; |
683 switch (property.cssProperty()) { | 683 switch (property.cssProperty()) { |
684 case CSSPropertyOpacity: { | 684 case CSSPropertyOpacity: { |
685 targetProperty = CompositorAnimation::TargetPropertyOpacity; | 685 targetProperty = CompositorTargetProperty::OPACITY; |
686 | 686 |
687 CompositorFloatAnimationCurve* floatCurve = CompositorFactory::curre
nt().createFloatAnimationCurve(); | 687 CompositorFloatAnimationCurve* floatCurve = CompositorFactory::curre
nt().createFloatAnimationCurve(); |
688 addKeyframesToCurve(*floatCurve, values, timing); | 688 addKeyframesToCurve(*floatCurve, values, timing); |
689 setTimingFunctionOnCurve(*floatCurve, timing.timingFunction.get()); | 689 setTimingFunctionOnCurve(*floatCurve, timing.timingFunction.get()); |
690 curve = adoptPtr(floatCurve); | 690 curve = adoptPtr(floatCurve); |
691 break; | 691 break; |
692 } | 692 } |
693 case CSSPropertyWebkitFilter: | 693 case CSSPropertyWebkitFilter: |
694 case CSSPropertyBackdropFilter: { | 694 case CSSPropertyBackdropFilter: { |
695 targetProperty = CompositorAnimation::TargetPropertyFilter; | 695 targetProperty = CompositorTargetProperty::FILTER; |
696 CompositorFilterAnimationCurve* filterCurve = CompositorFactory::cur
rent().createFilterAnimationCurve(); | 696 CompositorFilterAnimationCurve* filterCurve = CompositorFactory::cur
rent().createFilterAnimationCurve(); |
697 addKeyframesToCurve(*filterCurve, values, timing); | 697 addKeyframesToCurve(*filterCurve, values, timing); |
698 setTimingFunctionOnCurve(*filterCurve, timing.timingFunction.get()); | 698 setTimingFunctionOnCurve(*filterCurve, timing.timingFunction.get()); |
699 curve = adoptPtr(filterCurve); | 699 curve = adoptPtr(filterCurve); |
700 break; | 700 break; |
701 } | 701 } |
702 case CSSPropertyRotate: | 702 case CSSPropertyRotate: |
703 case CSSPropertyScale: | 703 case CSSPropertyScale: |
704 case CSSPropertyTranslate: | 704 case CSSPropertyTranslate: |
705 case CSSPropertyTransform: { | 705 case CSSPropertyTransform: { |
706 targetProperty = CompositorAnimation::TargetPropertyTransform; | 706 targetProperty = CompositorTargetProperty::TRANSFORM; |
707 CompositorTransformAnimationCurve* transformCurve = CompositorFactor
y::current().createTransformAnimationCurve(); | 707 CompositorTransformAnimationCurve* transformCurve = CompositorFactor
y::current().createTransformAnimationCurve(); |
708 addKeyframesToCurve(*transformCurve, values, timing); | 708 addKeyframesToCurve(*transformCurve, values, timing); |
709 setTimingFunctionOnCurve(*transformCurve, timing.timingFunction.get(
)); | 709 setTimingFunctionOnCurve(*transformCurve, timing.timingFunction.get(
)); |
710 curve = adoptPtr(transformCurve); | 710 curve = adoptPtr(transformCurve); |
711 break; | 711 break; |
712 } | 712 } |
713 default: | 713 default: |
714 ASSERT_NOT_REACHED(); | 714 ASSERT_NOT_REACHED(); |
715 continue; | 715 continue; |
716 } | 716 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 break; | 758 break; |
759 default: | 759 default: |
760 ASSERT_NOT_REACHED(); | 760 ASSERT_NOT_REACHED(); |
761 } | 761 } |
762 animations.append(animation.release()); | 762 animations.append(animation.release()); |
763 } | 763 } |
764 ASSERT(!animations.isEmpty()); | 764 ASSERT(!animations.isEmpty()); |
765 } | 765 } |
766 | 766 |
767 } // namespace blink | 767 } // namespace blink |
OLD | NEW |