Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5874)

Unified Diff: core/src/fxge/dib/fx_dib_engine.cpp

Issue 1727793002: Remove FXSYS_Div. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxge/agg/src/fx_agg_driver.cpp ('k') | core/src/fxge/ge/fx_ge_path.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/dib/fx_dib_engine.cpp
diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp
index 47fca79846a2025a0006a97bbf81ea70e890b4de..322040539ebd5f692d0172a6c096bc4e43c11797 100644
--- a/core/src/fxge/dib/fx_dib_engine.cpp
+++ b/core/src/fxge/dib/fx_dib_engine.cpp
@@ -20,7 +20,7 @@ void CWeightTable::Calc(int dest_len,
FX_Free(m_pWeightTables);
m_pWeightTables = NULL;
double scale, base;
- scale = FXSYS_Div((FX_FLOAT)(src_len), (FX_FLOAT)(dest_len));
+ scale = (FX_FLOAT)src_len / (FX_FLOAT)dest_len;
if (dest_len < 0) {
base = (FX_FLOAT)(src_len);
} else {
@@ -188,8 +188,8 @@ void CWeightTable::Calc(int dest_len,
pixel_weights.m_SrcStart = start_i;
pixel_weights.m_SrcEnd = end_i;
for (int j = start_i; j <= end_i; j++) {
- double dest_start = FXSYS_Div((FX_FLOAT)(j)-base, scale);
- double dest_end = FXSYS_Div((FX_FLOAT)(j + 1) - base, scale);
+ double dest_start = ((FX_FLOAT)j - base) / scale;
+ double dest_end = ((FX_FLOAT)(j + 1) - base) / scale;
if (dest_start > dest_end) {
double temp = dest_start;
dest_start = dest_end;
@@ -270,8 +270,8 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap,
m_Flags |= FXDIB_DOWNSAMPLE;
}
}
- double scale_x = FXSYS_Div((FX_FLOAT)(m_SrcWidth), (FX_FLOAT)(m_DestWidth));
- double scale_y = FXSYS_Div((FX_FLOAT)(m_SrcHeight), (FX_FLOAT)(m_DestHeight));
+ double scale_x = (FX_FLOAT)m_SrcWidth / (FX_FLOAT)m_DestWidth;
+ double scale_y = (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 = scale_x * ((FX_FLOAT)(clip_rect.left) + base_x);
« no previous file with comments | « core/src/fxge/agg/src/fx_agg_driver.cpp ('k') | core/src/fxge/ge/fx_ge_path.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698