Chromium Code Reviews| Index: Source/core/animation/CompositorAnimations.cpp |
| diff --git a/Source/core/animation/CompositorAnimations.cpp b/Source/core/animation/CompositorAnimations.cpp |
| index 674b9352f0fc4ab0fb5a387e6afa7c592d05947a..ed238c45e027d32afcd60ae6936e7381728019ce 100644 |
| --- a/Source/core/animation/CompositorAnimations.cpp |
| +++ b/Source/core/animation/CompositorAnimations.cpp |
| @@ -145,7 +145,6 @@ bool CompositorAnimations::isCandidateForAnimationOnCompositor(const Timing& tim |
| for (const auto& property : properties) { |
| const PropertySpecificKeyframeVector& keyframes = keyframeEffect.getPropertySpecificKeyframes(property); |
| ASSERT(keyframes.size() >= 2); |
| - auto* lastKeyframe = keyframes.last().get(); |
| for (const auto& keyframe : keyframes) { |
| // FIXME: Determine candidacy based on the CSSValue instead of a snapshot AnimatableValue. |
| if (keyframe->composite() != AnimationEffect::CompositeReplace || !keyframe->getAnimatableValue()) |
| @@ -167,10 +166,6 @@ bool CompositorAnimations::isCandidateForAnimationOnCompositor(const Timing& tim |
| default: |
| return false; |
| } |
| - |
| - // FIXME: Remove this check when crbug.com/229405 is resolved |
| - if (keyframe != lastKeyframe && keyframe->easing().type() == TimingFunction::StepsFunction) |
| - return false; |
| } |
| } |
| @@ -184,6 +179,9 @@ bool CompositorAnimations::isCandidateForAnimationOnCompositor(const Timing& tim |
| if (keyframes.size() == 2 && keyframes.first()->easing().type() == TimingFunction::LinearFunction && timing.timingFunction->type() != TimingFunction::StepsFunction) |
| return true; |
| + if (timing.timingFunction->type() == TimingFunction::StepsFunction) |
|
dstockwell
2014/12/19 02:00:55
I think this isn't quite right, as the comment bel
loyso (OOO)
2014/12/22 07:00:54
That wasn't right, indeed. Fixed.
|
| + return true; |
| + |
| // FIXME: Support non-linear timing functions in the compositor for |
| // more than two keyframes and step timing functions in the compositor. |
| return false; |
| @@ -330,8 +328,24 @@ void addKeyframeWithTimingFunction(PlatformAnimationCurveType& curve, const Plat |
| } |
| case TimingFunction::StepsFunction: |
| - default: |
| - ASSERT_NOT_REACHED(); |
| + const StepsTimingFunction* steps = toStepsTimingFunction(timingFunction); |
| + |
| + float stepsStartOffset; |
| + switch (steps->stepAtPosition()) { |
| + case StepsTimingFunction::Start: |
| + stepsStartOffset = 1; |
| + break; |
| + case StepsTimingFunction::Middle: |
| + stepsStartOffset = 0.5; |
| + break; |
| + case StepsTimingFunction::End: |
| + stepsStartOffset = 0; |
| + break; |
| + default: |
| + ASSERT_NOT_REACHED(); |
| + return; |
| + } |
| + curve.add(keyframe, steps->numberOfSteps(), stepsStartOffset); |
| return; |
| } |
| } |