summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-03 14:51:45 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-03 20:36:56 +0000
commit669a418f75c05d4a39e2bcaff2b7b93dec1c5764 (patch)
treeb76f5025c8e70b1ef449f317ff60a8eef7317ab9 /core/fxcodec/codec
parentac978f83392e309488601eb382d5f318b6d366ad (diff)
downloadpdfium-669a418f75c05d4a39e2bcaff2b7b93dec1c5764.tar.xz
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 <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec/codec')
-rw-r--r--core/fxcodec/codec/fx_codec_flate.cpp6
-rw-r--r--core/fxcodec/codec/fx_codec_progress.cpp30
2 files changed, 18 insertions, 18 deletions
diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp
index c73703fba5..dd9c4c9fa6 100644
--- a/core/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/fxcodec/codec/fx_codec_flate.cpp
@@ -244,9 +244,9 @@ int CLZWDecoder::Decode(uint8_t* dest_buf,
uint8_t PathPredictor(int a, int b, int c) {
int p = a + b - c;
- int pa = FXSYS_abs(p - a);
- int pb = FXSYS_abs(p - b);
- int pc = FXSYS_abs(p - c);
+ int pa = abs(p - a);
+ int pb = abs(p - b);
+ int pc = abs(p - c);
if (pa <= pb && pa <= pc)
return (uint8_t)a;
if (pb <= pc)
diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp
index bd890f89ff..e06c592cdc 100644
--- a/core/fxcodec/codec/fx_codec_progress.cpp
+++ b/core/fxcodec/codec/fx_codec_progress.cpp
@@ -57,17 +57,17 @@ void CCodec_ProgressiveDecoder::CFXCODEC_WeightTable::Calc(int dest_len,
} else {
base = 0.0f;
}
- m_ItemSize = (int)(sizeof(int) * 2 +
- sizeof(int) * (FXSYS_ceil(FXSYS_fabs((float)scale)) + 1));
+ m_ItemSize =
+ (int)(sizeof(int) * 2 + sizeof(int) * (ceil(fabs((float)scale)) + 1));
m_DestMin = dest_min;
m_pWeightTables.resize((dest_max - dest_min) * m_ItemSize + 4);
- if (FXSYS_fabs((float)scale) < 1.0f) {
+ if (fabs((float)scale) < 1.0f) {
for (int dest_pixel = dest_min; dest_pixel < dest_max; dest_pixel++) {
PixelWeight& pixel_weights = *GetPixelWeight(dest_pixel);
double src_pos = dest_pixel * scale + scale / 2 + base;
if (bInterpol) {
- pixel_weights.m_SrcStart = (int)FXSYS_floor((float)src_pos - 1.0f / 2);
- pixel_weights.m_SrcEnd = (int)FXSYS_floor((float)src_pos + 1.0f / 2);
+ pixel_weights.m_SrcStart = (int)floor((float)src_pos - 1.0f / 2);
+ pixel_weights.m_SrcEnd = (int)floor((float)src_pos + 1.0f / 2);
if (pixel_weights.m_SrcStart < src_min) {
pixel_weights.m_SrcStart = src_min;
}
@@ -83,7 +83,7 @@ void CCodec_ProgressiveDecoder::CFXCODEC_WeightTable::Calc(int dest_len,
}
} else {
pixel_weights.m_SrcStart = pixel_weights.m_SrcEnd =
- (int)FXSYS_floor((float)src_pos);
+ (int)floor((float)src_pos);
pixel_weights.m_Weights[0] = 65536;
}
}
@@ -95,11 +95,11 @@ void CCodec_ProgressiveDecoder::CFXCODEC_WeightTable::Calc(int dest_len,
double src_end = src_start + scale;
int start_i, end_i;
if (src_start < src_end) {
- start_i = (int)FXSYS_floor((float)src_start);
- end_i = (int)FXSYS_ceil((float)src_end);
+ start_i = (int)floor((float)src_start);
+ end_i = (int)ceil((float)src_end);
} else {
- start_i = (int)FXSYS_floor((float)src_end);
- end_i = (int)FXSYS_ceil((float)src_start);
+ start_i = (int)floor((float)src_end);
+ end_i = (int)ceil((float)src_start);
}
if (start_i < src_min) {
start_i = src_min;
@@ -1744,7 +1744,7 @@ void CCodec_ProgressiveDecoder::ResampleVert(
}
return;
}
- int multiple = (int)FXSYS_ceil((float)scale_y - 1);
+ int multiple = (int)ceil((float)scale_y - 1);
if (multiple > 0) {
uint8_t* scan_src =
(uint8_t*)pDeviceBitmap->GetScanline(des_row) + des_ScanOffet;
@@ -1874,19 +1874,19 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::StartDecode(
if (start_x < 0 || out_range_x > 0) {
float scaleX = (float)m_clipBox.Width() / (float)size_x;
if (start_x < 0) {
- m_clipBox.left -= (int32_t)FXSYS_ceil((float)start_x * scaleX);
+ m_clipBox.left -= (int32_t)ceil((float)start_x * scaleX);
}
if (out_range_x > 0) {
- m_clipBox.right -= (int32_t)FXSYS_floor((float)out_range_x * scaleX);
+ m_clipBox.right -= (int32_t)floor((float)out_range_x * scaleX);
}
}
if (start_y < 0 || out_range_y > 0) {
float scaleY = (float)m_clipBox.Height() / (float)size_y;
if (start_y < 0) {
- m_clipBox.top -= (int32_t)FXSYS_ceil((float)start_y * scaleY);
+ m_clipBox.top -= (int32_t)ceil((float)start_y * scaleY);
}
if (out_range_y > 0) {
- m_clipBox.bottom -= (int32_t)FXSYS_floor((float)out_range_y * scaleY);
+ m_clipBox.bottom -= (int32_t)floor((float)out_range_y * scaleY);
}
}
if (m_clipBox.IsEmpty()) {