From affe4b09575b297747e66bd0b807d2b1b04822fe Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 23 Feb 2016 16:04:59 -0500 Subject: Remove FXSYS_Div. This is just a wrapper for (a) / (b). Inline the divide. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1727793002 . --- core/src/fxge/win32/fx_win32_gdipext.cpp | 5 ++--- core/src/fxge/win32/fx_win32_print.cpp | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'core/src/fxge/win32') diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp index ce280948d7..e71d94d310 100644 --- a/core/src/fxge/win32/fx_win32_gdipext.cpp +++ b/core/src/fxge/win32/fx_win32_gdipext.cpp @@ -973,9 +973,8 @@ static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, FX_FLOAT width = pGraphState ? pGraphState->m_LineWidth : 1.0f; if (!bTextMode) { FX_FLOAT unit = - pMatrix - ? FXSYS_Div(1.0f, (pMatrix->GetXUnit() + pMatrix->GetYUnit()) / 2) - : 1.0f; + pMatrix ? 1.0f / ((pMatrix->GetXUnit() + pMatrix->GetYUnit()) / 2) + : 1.0f; if (width < unit) { width = unit; } diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp index 4816c03e2c..6c262d83dc 100644 --- a/core/src/fxge/win32/fx_win32_print.cpp +++ b/core/src/fxge/win32/fx_win32_print.cpp @@ -149,8 +149,7 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, uint8_t* src_buf = pSrcBitmap->GetBuffer(); FX_DWORD src_pitch = pSrcBitmap->GetPitch(); FX_FLOAT dest_area = pDestMatrix->GetUnitArea(); - FX_FLOAT area_scale = - FXSYS_Div((FX_FLOAT)(src_width * src_height), dest_area); + FX_FLOAT area_scale = ((FX_FLOAT)(src_width * src_height)) / dest_area; FX_FLOAT size_scale = FXSYS_sqrt(area_scale); CFX_Matrix adjusted_matrix(*pDestMatrix); adjusted_matrix.Scale(size_scale, size_scale); -- cgit v1.2.3