summaryrefslogtreecommitdiff
path: root/xfa/fde
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-03 14:51:45 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-03 20:36:56 +0000
commit669a418f75c05d4a39e2bcaff2b7b93dec1c5764 (patch)
treeb76f5025c8e70b1ef449f317ff60a8eef7317ab9 /xfa/fde
parentac978f83392e309488601eb382d5f318b6d366ad (diff)
downloadpdfium-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')
-rw-r--r--xfa/fde/cfde_path.cpp25
-rw-r--r--xfa/fde/cfde_renderdevice.cpp7
-rw-r--r--xfa/fde/cfde_txtedtengine.cpp3
-rw-r--r--xfa/fde/css/cfde_cssnumbervalue.cpp2
4 files changed, 17 insertions, 20 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();
diff --git a/xfa/fde/cfde_renderdevice.cpp b/xfa/fde/cfde_renderdevice.cpp
index d3456e17cb..6f2431737b 100644
--- a/xfa/fde/cfde_renderdevice.cpp
+++ b/xfa/fde/cfde_renderdevice.cpp
@@ -57,10 +57,9 @@ void CFDE_RenderDevice::RestoreState() {
bool CFDE_RenderDevice::SetClipRect(const CFX_RectF& rtClip) {
m_rtClip = rtClip;
- return m_pDevice->SetClip_Rect(FX_RECT((int32_t)FXSYS_floor(rtClip.left),
- (int32_t)FXSYS_floor(rtClip.top),
- (int32_t)FXSYS_ceil(rtClip.right()),
- (int32_t)FXSYS_ceil(rtClip.bottom())));
+ return m_pDevice->SetClip_Rect(
+ FX_RECT((int32_t)floor(rtClip.left), (int32_t)floor(rtClip.top),
+ (int32_t)ceil(rtClip.right()), (int32_t)ceil(rtClip.bottom())));
}
const CFX_RectF& CFDE_RenderDevice::GetClipRect() {
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp
index 15edfc1c1c..37e3e118d1 100644
--- a/xfa/fde/cfde_txtedtengine.cpp
+++ b/xfa/fde/cfde_txtedtengine.cpp
@@ -283,8 +283,7 @@ int32_t CFDE_TxtEdtEngine::MoveCaretPos(FDE_TXTEDTMOVECARET eMoveCaret,
break;
}
if (bShift && m_nAnchorPos != -1 && (m_nAnchorPos != m_nCaret)) {
- AddSelRange(std::min(m_nAnchorPos, m_nCaret),
- FXSYS_abs(m_nAnchorPos - m_nCaret));
+ AddSelRange(std::min(m_nAnchorPos, m_nCaret), abs(m_nAnchorPos - m_nCaret));
m_Param.pEventSink->OnSelChanged();
}
if (bSelChange)
diff --git a/xfa/fde/css/cfde_cssnumbervalue.cpp b/xfa/fde/css/cfde_cssnumbervalue.cpp
index e74ca5b859..45a9c917b1 100644
--- a/xfa/fde/css/cfde_cssnumbervalue.cpp
+++ b/xfa/fde/css/cfde_cssnumbervalue.cpp
@@ -8,7 +8,7 @@
CFDE_CSSNumberValue::CFDE_CSSNumberValue(FDE_CSSNumberType type, float value)
: CFDE_CSSValue(FDE_CSSPrimitiveType::Number), type_(type), value_(value) {
- if (type_ == FDE_CSSNumberType::Number && FXSYS_fabs(value_) < 0.001f)
+ if (type_ == FDE_CSSNumberType::Number && fabs(value_) < 0.001f)
value_ = 0.0f;
}