From 2c8fad44315db58f5b3222161dcb699691dca904 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 23 Feb 2016 15:23:29 -0500 Subject: 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 . --- core/src/fxge/ge/fx_ge_path.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'core/src/fxge/ge') diff --git a/core/src/fxge/ge/fx_ge_path.cpp b/core/src/fxge/ge/fx_ge_path.cpp index 23b1c2fe07..0084f092d1 100644 --- a/core/src/fxge/ge/fx_ge_path.cpp +++ b/core/src/fxge/ge/fx_ge_path.cpp @@ -264,14 +264,14 @@ static void _UpdateLineJoinPoints(CFX_FloatRect& rect, } if (!bStartVert) { start_k = FXSYS_Div(middle_y - start_y, middle_x - start_x); - start_c = middle_y - FXSYS_Mul(start_k, middle_x); + start_c = middle_y - (start_k * middle_x); start_len = FXSYS_sqrt2(start_x - middle_x, start_y - middle_y); start_dc = (FX_FLOAT)FXSYS_fabs( FXSYS_MulDiv(half_width, start_len, start_x - middle_x)); } if (!bEndVert) { end_k = FXSYS_Div(end_y - middle_y, end_x - middle_x); - end_c = middle_y - FXSYS_Mul(end_k, middle_x); + end_c = middle_y - (end_k * middle_x); end_len = FXSYS_sqrt2(end_x - middle_x, end_y - middle_y); end_dc = (FX_FLOAT)FXSYS_fabs( FXSYS_MulDiv(half_width, end_len, end_x - middle_x)); @@ -284,10 +284,10 @@ static void _UpdateLineJoinPoints(CFX_FloatRect& rect, outside_x -= half_width; } FX_FLOAT outside_y; - if (start_y < FXSYS_Mul(end_k, start_x) + end_c) { - outside_y = FXSYS_Mul(end_k, outside_x) + end_c + end_dc; + if (start_y < (end_k * start_x) + end_c) { + outside_y = (end_k * outside_x) + end_c + end_dc; } else { - outside_y = FXSYS_Mul(end_k, outside_x) + end_c - end_dc; + outside_y = (end_k * outside_x) + end_c - end_dc; } rect.UpdateRect(outside_x, outside_y); return; @@ -300,10 +300,10 @@ static void _UpdateLineJoinPoints(CFX_FloatRect& rect, outside_x -= half_width; } FX_FLOAT outside_y; - if (end_y < FXSYS_Mul(start_k, end_x) + start_c) { - outside_y = FXSYS_Mul(start_k, outside_x) + start_c + start_dc; + if (end_y < (start_k * end_x) + start_c) { + outside_y = (start_k * outside_x) + start_c + start_dc; } else { - outside_y = FXSYS_Mul(start_k, outside_x) + start_c - start_dc; + outside_y = (start_k * outside_x) + start_c - start_dc; } rect.UpdateRect(outside_x, outside_y); return; @@ -320,19 +320,19 @@ static void _UpdateLineJoinPoints(CFX_FloatRect& rect, return; } FX_FLOAT start_outside_c = start_c; - if (end_y < FXSYS_Mul(start_k, end_x) + start_c) { + if (end_y < (start_k * end_x) + start_c) { start_outside_c += start_dc; } else { start_outside_c -= start_dc; } FX_FLOAT end_outside_c = end_c; - if (start_y < FXSYS_Mul(end_k, start_x) + end_c) { + if (start_y < (end_k * start_x) + end_c) { end_outside_c += end_dc; } else { end_outside_c -= end_dc; } FX_FLOAT join_x = FXSYS_Div(end_outside_c - start_outside_c, start_k - end_k); - FX_FLOAT join_y = FXSYS_Mul(start_k, join_x) + start_outside_c; + FX_FLOAT join_y = (start_k * join_x) + start_outside_c; rect.UpdateRect(join_x, join_y); } CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, -- cgit v1.2.3