diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-04-03 14:51:45 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-03 20:36:56 +0000 |
commit | 669a418f75c05d4a39e2bcaff2b7b93dec1c5764 (patch) | |
tree | b76f5025c8e70b1ef449f317ff60a8eef7317ab9 /xfa/fde/cfde_path.cpp | |
parent | ac978f83392e309488601eb382d5f318b6d366ad (diff) | |
download | pdfium-669a418f75c05d4a39e2bcaff2b7b93dec1c5764.tar.xz |
Drop FXSYS_ from math methods
This Cl drops the FXSYS_ from math methods which are the same on all
platforms.
Bug: pdfium:694
Change-Id: I85c9ff841fd9095b1434f67319847ba0cd9df7ac
Reviewed-on: https://pdfium-review.googlesource.com/3598
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_path.cpp')
-rw-r--r-- | xfa/fde/cfde_path.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/xfa/fde/cfde_path.cpp b/xfa/fde/cfde_path.cpp index 4afa718978..a7d2e47ac1 100644 --- a/xfa/fde/cfde_path.cpp +++ b/xfa/fde/cfde_path.cpp @@ -41,10 +41,9 @@ void CFDE_Path::ArcTo(bool bStart, float ry = rect.height / 2; float cx = rect.left + rx; float cy = rect.top + ry; - float alpha = - FXSYS_atan2(rx * FXSYS_sin(startAngle), ry * FXSYS_cos(startAngle)); - float beta = FXSYS_atan2(rx * FXSYS_sin(endAngle), ry * FXSYS_cos(endAngle)); - if (FXSYS_fabs(beta - alpha) > FX_PI) { + float alpha = atan2(rx * sin(startAngle), ry * cos(startAngle)); + float beta = atan2(rx * sin(endAngle), ry * cos(endAngle)); + if (fabs(beta - alpha) > FX_PI) { if (beta > alpha) beta -= 2 * FX_PI; else @@ -52,11 +51,11 @@ void CFDE_Path::ArcTo(bool bStart, } float half_delta = (beta - alpha) / 2; - float bcp = 4.0f / 3 * (1 - FXSYS_cos(half_delta)) / FXSYS_sin(half_delta); - float sin_alpha = FXSYS_sin(alpha); - float sin_beta = FXSYS_sin(beta); - float cos_alpha = FXSYS_cos(alpha); - float cos_beta = FXSYS_cos(beta); + float bcp = 4.0f / 3 * (1 - cos(half_delta)) / sin(half_delta); + float sin_alpha = sin(alpha); + float sin_beta = sin(beta); + float cos_alpha = cos(alpha); + float cos_beta = cos(beta); if (bStart) MoveTo(CFX_PointF(cx + rx * cos_alpha, cy + ry * sin_alpha)); @@ -154,8 +153,8 @@ void CFDE_Path::AddEllipse(const CFX_RectF& rect) { void CFDE_Path::AddLine(const CFX_PointF& pt1, const CFX_PointF& pt2) { std::vector<FX_PATHPOINT>& points = m_Path.GetPoints(); - if (points.empty() || FXSYS_fabs(points.back().m_Point.x - pt1.x) > 0.001 || - FXSYS_fabs(points.back().m_Point.y - pt1.y) > 0.001) { + if (points.empty() || fabs(points.back().m_Point.x - pt1.x) > 0.001 || + fabs(points.back().m_Point.y - pt1.y) > 0.001) { MoveTo(pt1); } LineTo(pt2); @@ -180,8 +179,8 @@ void CFDE_Path::AddPolygon(const std::vector<CFX_PointF>& points) { AddLines(points); const CFX_PointF* p = points.data(); - if (FXSYS_fabs(p[0].x - p[iCount - 1].x) < 0.01f || - FXSYS_fabs(p[0].y - p[iCount - 1].y) < 0.01f) { + if (fabs(p[0].x - p[iCount - 1].x) < 0.01f || + fabs(p[0].y - p[iCount - 1].y) < 0.01f) { LineTo(p[0]); } CloseFigure(); |