mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-27 02:43:07 +00:00
Bug 1399714 - Iterate animation segments for setting start/end values and timing functions just once. r=boris
MozReview-Commit-ID: 7ySuFcSi3cH --HG-- extra : rebase_source : aef6b905fb34782700fc354905fc0a5d4c72e857
This commit is contained in:
parent
38ed548903
commit
aef8a014cd
@ -515,22 +515,18 @@ AnimationHelper::SetAnimations(AnimationArray& aAnimations,
|
||||
AnimData* data = aAnimData.AppendElement();
|
||||
InfallibleTArray<Maybe<ComputedTimingFunction>>& functions =
|
||||
data->mFunctions;
|
||||
const InfallibleTArray<AnimationSegment>& segments = animation.segments();
|
||||
for (uint32_t j = 0; j < segments.Length(); j++) {
|
||||
TimingFunction tf = segments.ElementAt(j).sampleFn();
|
||||
|
||||
Maybe<ComputedTimingFunction> ctf =
|
||||
AnimationUtils::TimingFunctionToComputedTimingFunction(tf);
|
||||
functions.AppendElement(ctf);
|
||||
}
|
||||
|
||||
// Precompute the StyleAnimationValues that we need if this is a transform
|
||||
// animation.
|
||||
InfallibleTArray<StyleAnimationValue>& startValues = data->mStartValues;
|
||||
InfallibleTArray<StyleAnimationValue>& endValues = data->mEndValues;
|
||||
|
||||
const InfallibleTArray<AnimationSegment>& segments = animation.segments();
|
||||
for (const AnimationSegment& segment : segments) {
|
||||
startValues.AppendElement(ToStyleAnimationValue(segment.startState()));
|
||||
endValues.AppendElement(ToStyleAnimationValue(segment.endState()));
|
||||
|
||||
TimingFunction tf = segment.sampleFn();
|
||||
Maybe<ComputedTimingFunction> ctf =
|
||||
AnimationUtils::TimingFunctionToComputedTimingFunction(tf);
|
||||
functions.AppendElement(ctf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user