зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1354947 - Add equal operators for comparing ComputedTimingFunction with nsTimingFunction. r=birtles
MozReview-Commit-ID: 7pQQP3xlKot --HG-- extra : rebase_source : 08f7fa7739778942eea94e7987e268e2d5196b77
This commit is contained in:
Родитель
b8f09b427c
Коммит
b56f6b1267
|
@ -80,6 +80,20 @@ public:
|
|||
{
|
||||
return !(*this == aOther);
|
||||
}
|
||||
bool operator==(const nsTimingFunction& aOther) const
|
||||
{
|
||||
return mType == aOther.mType &&
|
||||
(HasSpline()
|
||||
? mTimingFunction.X1() == aOther.mFunc.mX1 &&
|
||||
mTimingFunction.Y1() == aOther.mFunc.mY1 &&
|
||||
mTimingFunction.X2() == aOther.mFunc.mX2 &&
|
||||
mTimingFunction.Y2() == aOther.mFunc.mY2
|
||||
: mStepsOrFrames == aOther.mStepsOrFrames);
|
||||
}
|
||||
bool operator!=(const nsTimingFunction& aOther) const
|
||||
{
|
||||
return !(*this == aOther);
|
||||
}
|
||||
int32_t Compare(const ComputedTimingFunction& aRhs) const;
|
||||
void AppendToString(nsAString& aResult) const;
|
||||
|
||||
|
@ -105,6 +119,23 @@ private:
|
|||
uint32_t mStepsOrFrames;
|
||||
};
|
||||
|
||||
inline bool
|
||||
operator==(const Maybe<ComputedTimingFunction>& aLHS,
|
||||
const nsTimingFunction& aRHS)
|
||||
{
|
||||
if (aLHS.isNothing()) {
|
||||
return aRHS.mType == nsTimingFunction::Type::Linear;
|
||||
}
|
||||
return aLHS.value() == aRHS;
|
||||
}
|
||||
|
||||
inline bool
|
||||
operator!=(const Maybe<ComputedTimingFunction>& aLHS,
|
||||
const nsTimingFunction& aRHS)
|
||||
{
|
||||
return !(aLHS == aRHS);
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_ComputedTimingFunction_h
|
||||
|
|
Загрузка…
Ссылка в новой задаче