summaryrefslogtreecommitdiff
path: root/core/src/fxge
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-02-23 15:23:29 -0500
committerDan Sinclair <dsinclair@chromium.org>2016-02-23 15:23:29 -0500
commit2c8fad44315db58f5b3222161dcb699691dca904 (patch)
tree70e9bdf55e1e3197d8bd088abd103012b602e32f /core/src/fxge
parent2886a25b68225ad3ad70d417b01108ad1d126488 (diff)
downloadpdfium-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 'core/src/fxge')
-rw-r--r--core/src/fxge/dib/fx_dib_engine.cpp8
-rw-r--r--core/src/fxge/ge/fx_ge_path.cpp22
-rw-r--r--core/src/fxge/win32/fx_win32_gdipext.cpp2
3 files changed, 16 insertions, 16 deletions
diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp
index de56567c51..47fca79846 100644
--- a/core/src/fxge/dib/fx_dib_engine.cpp
+++ b/core/src/fxge/dib/fx_dib_engine.cpp
@@ -274,10 +274,10 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap,
double scale_y = FXSYS_Div((FX_FLOAT)(m_SrcHeight), (FX_FLOAT)(m_DestHeight));
double base_x = m_DestWidth > 0 ? 0.0f : (FX_FLOAT)(m_DestWidth);
double base_y = m_DestHeight > 0 ? 0.0f : (FX_FLOAT)(m_DestHeight);
- double src_left = FXSYS_Mul(scale_x, (FX_FLOAT)(clip_rect.left) + base_x);
- double src_right = FXSYS_Mul(scale_x, (FX_FLOAT)(clip_rect.right) + base_x);
- double src_top = FXSYS_Mul(scale_y, (FX_FLOAT)(clip_rect.top) + base_y);
- double src_bottom = FXSYS_Mul(scale_y, (FX_FLOAT)(clip_rect.bottom) + base_y);
+ double src_left = scale_x * ((FX_FLOAT)(clip_rect.left) + base_x);
+ double src_right = scale_x * ((FX_FLOAT)(clip_rect.right) + base_x);
+ double src_top = scale_y * ((FX_FLOAT)(clip_rect.top) + base_y);
+ double src_bottom = scale_y * ((FX_FLOAT)(clip_rect.bottom) + base_y);
if (src_left > src_right) {
double temp = src_left;
src_left = src_right;
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,
diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp
index aaf7c36919..ce280948d7 100644
--- a/core/src/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/src/fxge/win32/fx_win32_gdipext.cpp
@@ -1087,7 +1087,7 @@ static FX_BOOL IsSmallTriangle(PointF* points,
}
FX_FLOAT dx = x1 - x2;
FX_FLOAT dy = y1 - y2;
- FX_FLOAT distance_square = FXSYS_Mul(dx, dx) + FXSYS_Mul(dy, dy);
+ FX_FLOAT distance_square = (dx * dx) + (dy * dy);
if (distance_square < (1.0f * 2 + 1.0f / 4)) {
v1 = i;
v2 = pair1;