mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1216842 - Part 1: Add null_t into TimingFunction to skip calculation of linear timing function. r=cam
This is a patch for compositor side to represent linear function as null_t/Nothing(). Also the first argument of ToTimingFunction changes to a Maybe<ComputedTimingFunction>. As a result of this change we can also use ToTimingFunction for animation effect's timing function.
This commit is contained in:
parent
1a086bb8f8
commit
52d846dacd
@ -93,6 +93,7 @@ struct StepFunction {
|
||||
};
|
||||
|
||||
union TimingFunction {
|
||||
null_t;
|
||||
CubicBezierFunction;
|
||||
StepFunction;
|
||||
};
|
||||
|
@ -347,16 +347,20 @@ static void AddTransformFunctions(nsCSSValueList* aList,
|
||||
}
|
||||
|
||||
static TimingFunction
|
||||
ToTimingFunction(const ComputedTimingFunction& aCTF)
|
||||
ToTimingFunction(Maybe<ComputedTimingFunction> aCTF)
|
||||
{
|
||||
if (aCTF.HasSpline()) {
|
||||
const nsSMILKeySpline* spline = aCTF.GetFunction();
|
||||
if (aCTF.isNothing()) {
|
||||
return TimingFunction(null_t());
|
||||
}
|
||||
|
||||
if (aCTF->HasSpline()) {
|
||||
const nsSMILKeySpline* spline = aCTF->GetFunction();
|
||||
return TimingFunction(CubicBezierFunction(spline->X1(), spline->Y1(),
|
||||
spline->X2(), spline->Y2()));
|
||||
}
|
||||
|
||||
uint32_t type = aCTF.GetType() == nsTimingFunction::Type::StepStart ? 1 : 2;
|
||||
return TimingFunction(StepFunction(aCTF.GetSteps(), type));
|
||||
uint32_t type = aCTF->GetType() == nsTimingFunction::Type::StepStart ? 1 : 2;
|
||||
return TimingFunction(StepFunction(aCTF->GetSteps(), type));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -421,7 +425,7 @@ AddAnimationForProperty(nsIFrame* aFrame, const AnimationProperty& aProperty,
|
||||
|
||||
animSegment->startPortion() = segment.mFromKey;
|
||||
animSegment->endPortion() = segment.mToKey;
|
||||
animSegment->sampleFn() = ToTimingFunction(segment.mTimingFunction);
|
||||
animSegment->sampleFn() = ToTimingFunction(Some(segment.mTimingFunction));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user