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:
Jeff Muizelaar 2009-07-15 14:08:57 -04:00
Родитель 65d7eefd9c
Коммит 9e0f7bd861
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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