From 669a418f75c05d4a39e2bcaff2b7b93dec1c5764 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 3 Apr 2017 14:51:45 -0400 Subject: 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 Reviewed-by: Tom Sepez --- core/fxge/win32/cfx_psrenderer.cpp | 16 ++++++++-------- core/fxge/win32/fx_win32_device.cpp | 7 +++---- core/fxge/win32/fx_win32_print.cpp | 6 +++--- 3 files changed, 14 insertions(+), 15 deletions(-) (limited to 'core/fxge/win32') diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp index 5dd9079c36..40c643ea14 100644 --- a/core/fxge/win32/cfx_psrenderer.cpp +++ b/core/fxge/win32/cfx_psrenderer.cpp @@ -533,14 +533,14 @@ void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, pPSFont->m_Glyphs[j].m_GlyphIndex == charpos.m_GlyphIndex && ((!pPSFont->m_Glyphs[j].m_bGlyphAdjust && !charpos.m_bGlyphAdjust) || (pPSFont->m_Glyphs[j].m_bGlyphAdjust && charpos.m_bGlyphAdjust && - (FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[0] - - charpos.m_AdjustMatrix[0]) < 0.01 && - FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[1] - - charpos.m_AdjustMatrix[1]) < 0.01 && - FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[2] - - charpos.m_AdjustMatrix[2]) < 0.01 && - FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[3] - - charpos.m_AdjustMatrix[3]) < 0.01)))) { + (fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[0] - + charpos.m_AdjustMatrix[0]) < 0.01 && + fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[1] - + charpos.m_AdjustMatrix[1]) < 0.01 && + fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[2] - + charpos.m_AdjustMatrix[2]) < 0.01 && + fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[3] - + charpos.m_AdjustMatrix[3]) < 0.01)))) { *ps_fontnum = i; *ps_glyphindex = j; return; diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index 3b56477e7e..de17c0d0b5 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -95,9 +95,8 @@ HPEN CreatePen(const CFX_GraphStateData* pGraphState, float width; float scale = 1.f; if (pMatrix) - scale = FXSYS_fabs(pMatrix->a) > FXSYS_fabs(pMatrix->b) - ? FXSYS_fabs(pMatrix->a) - : FXSYS_fabs(pMatrix->b); + scale = fabs(pMatrix->a) > fabs(pMatrix->b) ? fabs(pMatrix->a) + : fabs(pMatrix->b); if (pGraphState) { width = scale * pGraphState->m_LineWidth; } else { @@ -151,7 +150,7 @@ HPEN CreatePen(const CFX_GraphStateData* pGraphState, dashes[i] = std::max(dashes[i], 1U); } } - return ExtCreatePen(PenStyle, (DWORD)FXSYS_ceil(width), &lb, + return ExtCreatePen(PenStyle, (DWORD)ceil(width), &lb, pGraphState->m_DashCount, reinterpret_cast(dashes.data())); } diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp index 26ac6605fb..868c113880 100644 --- a/core/fxge/win32/fx_win32_print.cpp +++ b/core/fxge/win32/fx_win32_print.cpp @@ -172,8 +172,8 @@ bool CGdiPrinterDriver::StartDIBits(const CFX_RetainPtr& pSource, } CFX_FloatRect unit_rect = pMatrix->GetUnitRect(); FX_RECT full_rect = unit_rect.GetOuterRect(); - if (FXSYS_fabs(pMatrix->b) < 0.5f && pMatrix->a != 0 && - FXSYS_fabs(pMatrix->c) < 0.5f && pMatrix->d != 0) { + if (fabs(pMatrix->b) < 0.5f && pMatrix->a != 0 && fabs(pMatrix->c) < 0.5f && + pMatrix->d != 0) { bool bFlipX = pMatrix->a < 0; bool bFlipY = pMatrix->d > 0; return StretchDIBits(pSource, color, @@ -183,7 +183,7 @@ bool CGdiPrinterDriver::StartDIBits(const CFX_RetainPtr& pSource, bFlipY ? -full_rect.Height() : full_rect.Height(), nullptr, 0, blend_type); } - if (FXSYS_fabs(pMatrix->a) >= 0.5f || FXSYS_fabs(pMatrix->d) >= 0.5f) + if (fabs(pMatrix->a) >= 0.5f || fabs(pMatrix->d) >= 0.5f) return false; CFX_RetainPtr pTransformed = -- cgit v1.2.3