Bug 1209206 (part 3) - Use sinf() and cosf() instead of sin() and cos() in a couple of places. r=Bas.

This commit is contained in:
Nicholas Nethercote 2015-09-28 17:12:07 -07:00
parent 8fd9cbd2d0
commit 0a529cbb82
3 changed files with 10 additions and 10 deletions

View File

@ -90,8 +90,8 @@ Matrix::Rotation(Float aAngle)
{
Matrix newMatrix;
Float s = sin(aAngle);
Float c = cos(aAngle);
Float s = sinf(aAngle);
Float c = cosf(aAngle);
newMatrix._11 = c;
newMatrix._12 = s;

View File

@ -267,8 +267,8 @@ PathBuilderD2D::Arc(const Point &aOrigin, Float aRadius, Float aStartAngle,
}
Point endPoint;
endPoint.x = aOrigin.x + aRadius * cos(aEndAngle);
endPoint.y = aOrigin.y + aRadius * sin(aEndAngle);
endPoint.x = aOrigin.x + aRadius * cosf(aEndAngle);
endPoint.y = aOrigin.y + aRadius * sinf(aEndAngle);
D2D1_ARC_SIZE arcSize = D2D1_ARC_SIZE_SMALL;
D2D1_SWEEP_DIRECTION direction =
@ -296,8 +296,8 @@ PathBuilderD2D::Arc(const Point &aOrigin, Float aRadius, Float aStartAngle,
else {
// draw small circles as two half-circles
Point midPoint;
midPoint.x = aOrigin.x + aRadius * cos(midAngle);
midPoint.y = aOrigin.y + aRadius * sin(midAngle);
midPoint.x = aOrigin.x + aRadius * cosf(midAngle);
midPoint.y = aOrigin.y + aRadius * sinf(midAngle);
mSink->AddArc(D2D1::ArcSegment(D2DPoint(midPoint),
D2D1::SizeF(aRadius, aRadius),

View File

@ -185,8 +185,8 @@ inline float EvalLanczos(int filter_size, float x) {
x < std::numeric_limits<float>::epsilon())
return 1.0f; // Special case the discontinuity at the origin.
float xpi = x * static_cast<float>(M_PI);
return (sin(xpi) / xpi) * // sinc(x)
sin(xpi / filter_size) / (xpi / filter_size); // sinc(x/filter_size)
return (sinf(xpi) / xpi) * // sinc(x)
sinf(xpi / filter_size) / (xpi / filter_size); // sinc(x/filter_size)
}
// Evaluates the Hamming filter of the given filter size window for the given
@ -212,8 +212,8 @@ inline float EvalHamming(int filter_size, float x) {
return 1.0f; // Special case the sinc discontinuity at the origin.
const float xpi = x * static_cast<float>(M_PI);
return ((sin(xpi) / xpi) * // sinc(x)
(0.54f + 0.46f * cos(xpi / filter_size))); // hamming(x)
return ((sinf(xpi) / xpi) * // sinc(x)
(0.54f + 0.46f * cosf(xpi / filter_size))); // hamming(x)
}
// ResizeFilter ----------------------------------------------------------------