diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2016-02-23 15:23:29 -0500 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2016-02-23 15:23:29 -0500 |
commit | 2c8fad44315db58f5b3222161dcb699691dca904 (patch) | |
tree | 70e9bdf55e1e3197d8bd088abd103012b602e32f /xfa/src/fxgraphics/src/fx_path_generator.cpp | |
parent | 2886a25b68225ad3ad70d417b01108ad1d126488 (diff) | |
download | pdfium-2c8fad44315db58f5b3222161dcb699691dca904.tar.xz |
Remove FXSYS_Mul.
This define just multiples the two parameters together. Inline the *'s.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1729613003 .
Diffstat (limited to 'xfa/src/fxgraphics/src/fx_path_generator.cpp')
-rw-r--r-- | xfa/src/fxgraphics/src/fx_path_generator.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/xfa/src/fxgraphics/src/fx_path_generator.cpp b/xfa/src/fxgraphics/src/fx_path_generator.cpp index 8d5030ac5b..c9e20b35d2 100644 --- a/xfa/src/fxgraphics/src/fx_path_generator.cpp +++ b/xfa/src/fxgraphics/src/fx_path_generator.cpp @@ -120,7 +120,7 @@ void CFX_PathGenerator::ArcTo(FX_FLOAT x, FX_FLOAT x0 = FXSYS_cos(sweep_angle / 2); FX_FLOAT y0 = FXSYS_sin(sweep_angle / 2); FX_FLOAT tx = FXSYS_Div((1.0f - x0) * 4, 3 * 1.0f); - FX_FLOAT ty = y0 - FXSYS_Div(FXSYS_Mul(tx, x0), y0); + FX_FLOAT ty = y0 - FXSYS_Div(tx * x0, y0); FX_FLOAT px[3], py[3]; px[0] = x0 + tx; py[0] = -ty; @@ -131,14 +131,14 @@ void CFX_PathGenerator::ArcTo(FX_FLOAT x, int old_count = m_pPathData->GetPointCount(); m_pPathData->AddPointCount(3); FX_FLOAT bezier_x, bezier_y; - bezier_x = x + FXSYS_Mul(width, FXSYS_Mul(px[0], cs) - FXSYS_Mul(py[0], sn)); - bezier_y = y + FXSYS_Mul(height, FXSYS_Mul(px[0], sn) + FXSYS_Mul(py[0], cs)); + bezier_x = x + (width * ((px[0] * cs) - (py[0] * sn))); + bezier_y = y + (height * ((px[0] * sn) + (py[0] * cs))); m_pPathData->SetPoint(old_count, bezier_x, bezier_y, FXPT_BEZIERTO); - bezier_x = x + FXSYS_Mul(width, FXSYS_Mul(px[1], cs) - FXSYS_Mul(py[1], sn)); - bezier_y = y + FXSYS_Mul(height, FXSYS_Mul(px[1], sn) + FXSYS_Mul(py[1], cs)); + bezier_x = x + (width * ((px[1] * cs) - (py[1] * sn))); + bezier_y = y + (height * ((px[1] * sn) + (py[1] * cs))); m_pPathData->SetPoint(old_count + 1, bezier_x, bezier_y, FXPT_BEZIERTO); - bezier_x = x + FXSYS_Mul(width, FXSYS_cos(start_angle + sweep_angle)), - bezier_y = y + FXSYS_Mul(height, FXSYS_sin(start_angle + sweep_angle)); + bezier_x = x + (width * FXSYS_cos(start_angle + sweep_angle)); + bezier_y = y + (height * FXSYS_sin(start_angle + sweep_angle)); m_pPathData->SetPoint(old_count + 2, bezier_x, bezier_y, FXPT_BEZIERTO); } void CFX_PathGenerator::AddArc(FX_FLOAT x, @@ -189,9 +189,8 @@ void CFX_PathGenerator::AddArc(FX_FLOAT x, } m_pPathData->AddPointCount(1); m_pPathData->SetPoint(m_pPathData->GetPointCount() - 1, - x + FXSYS_Mul(width, FXSYS_cos(start_angle)), - y + FXSYS_Mul(height, FXSYS_sin(start_angle)), - FXPT_MOVETO); + x + (width * FXSYS_cos(start_angle)), + y + (height * FXSYS_sin(start_angle)), FXPT_MOVETO); FX_FLOAT total_sweep = 0, local_sweep = 0, prev_sweep = 0; FX_BOOL done = FALSE; do { @@ -227,9 +226,8 @@ void CFX_PathGenerator::AddPie(FX_FLOAT x, int old_count = m_pPathData->GetPointCount(); m_pPathData->AddPointCount(2); m_pPathData->SetPoint(old_count, x, y, FXPT_MOVETO); - m_pPathData->SetPoint( - old_count + 1, x + FXSYS_Mul(width, FXSYS_cos(start_angle)), - y + FXSYS_Mul(height, FXSYS_sin(start_angle)), FXPT_LINETO); + m_pPathData->SetPoint(old_count + 1, x + (width * FXSYS_cos(start_angle)), + y + (height * FXSYS_sin(start_angle)), FXPT_LINETO); return; } AddArc(x, y, width, height, start_angle, sweep_angle); |