зеркало из https://github.com/mozilla/pjs.git
Bug 501428. SMIL: Optimize nsSMILKeySpline::CalcBezier. r=dholbert, r=longsonr
Eliminates the call to pow() and reduces the number of multiplications from 4 to 3.
This commit is contained in:
Родитель
ef5bda50fa
Коммит
452d6cf304
|
@ -78,7 +78,8 @@ nsSMILKeySpline::CalcBezier(double aT,
|
|||
double aA1,
|
||||
double aA2)
|
||||
{
|
||||
return A(aA1, aA2) * pow(aT,3) + B(aA1, aA2)*aT*aT + C(aA1) * aT;
|
||||
// use Horner's scheme to evaluate the Bezier polynomial
|
||||
return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;
|
||||
}
|
||||
|
||||
/*static*/ double
|
||||
|
|
Загрузка…
Ссылка в новой задаче