summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/agg/fx_agg_driver.cpp3
-rw-r--r--core/fxge/dib/cfx_dibsource.cpp2
-rw-r--r--core/fxge/dib/cfx_imagerenderer.cpp10
-rw-r--r--core/fxge/dib/cfx_imagetransformer.cpp21
-rw-r--r--core/fxge/dib/fx_dib_engine.cpp39
-rw-r--r--core/fxge/ge/cfx_facecache.cpp10
-rw-r--r--core/fxge/ge/cfx_fontmapper.cpp2
-rw-r--r--core/fxge/ge/cfx_pathdata.cpp19
-rw-r--r--core/fxge/ge/cfx_renderdevice.cpp22
-rw-r--r--core/fxge/win32/cfx_psrenderer.cpp16
-rw-r--r--core/fxge/win32/fx_win32_device.cpp7
-rw-r--r--core/fxge/win32/fx_win32_print.cpp6
12 files changed, 76 insertions, 81 deletions
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index 8cada7cf64..031246b494 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -1449,8 +1449,7 @@ bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
CFX_Matrix matrix1;
CFX_Matrix matrix2;
if (pObject2Device) {
- matrix1.a =
- std::max(FXSYS_fabs(pObject2Device->a), FXSYS_fabs(pObject2Device->b));
+ matrix1.a = std::max(fabs(pObject2Device->a), fabs(pObject2Device->b));
matrix1.d = matrix1.a;
matrix2 = CFX_Matrix(
pObject2Device->a / matrix1.a, pObject2Device->b / matrix1.a,
diff --git a/core/fxge/dib/cfx_dibsource.cpp b/core/fxge/dib/cfx_dibsource.cpp
index 4cdedd1051..4b76b02ee7 100644
--- a/core/fxge/dib/cfx_dibsource.cpp
+++ b/core/fxge/dib/cfx_dibsource.cpp
@@ -513,7 +513,7 @@ CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::StretchTo(int dest_width,
uint32_t flags,
const FX_RECT* pClip) {
CFX_RetainPtr<CFX_DIBSource> holder(this);
- FX_RECT clip_rect(0, 0, FXSYS_abs(dest_width), FXSYS_abs(dest_height));
+ FX_RECT clip_rect(0, 0, abs(dest_width), abs(dest_height));
if (pClip)
clip_rect.Intersect(*pClip);
diff --git a/core/fxge/dib/cfx_imagerenderer.cpp b/core/fxge/dib/cfx_imagerenderer.cpp
index 776ba92775..89eb48f0cb 100644
--- a/core/fxge/dib/cfx_imagerenderer.cpp
+++ b/core/fxge/dib/cfx_imagerenderer.cpp
@@ -53,11 +53,11 @@ bool CFX_ImageRenderer::Start(const CFX_RetainPtr<CFX_DIBitmap>& pDevice,
m_bRgbByteOrder = bRgbByteOrder;
m_BlendType = blend_type;
- if ((FXSYS_fabs(m_Matrix.b) >= 0.5f || m_Matrix.a == 0) ||
- (FXSYS_fabs(m_Matrix.c) >= 0.5f || m_Matrix.d == 0)) {
- if (FXSYS_fabs(m_Matrix.a) < FXSYS_fabs(m_Matrix.b) / 20 &&
- FXSYS_fabs(m_Matrix.d) < FXSYS_fabs(m_Matrix.c) / 20 &&
- FXSYS_fabs(m_Matrix.a) < 0.5f && FXSYS_fabs(m_Matrix.d) < 0.5f) {
+ if ((fabs(m_Matrix.b) >= 0.5f || m_Matrix.a == 0) ||
+ (fabs(m_Matrix.c) >= 0.5f || m_Matrix.d == 0)) {
+ if (fabs(m_Matrix.a) < fabs(m_Matrix.b) / 20 &&
+ fabs(m_Matrix.d) < fabs(m_Matrix.c) / 20 && fabs(m_Matrix.a) < 0.5f &&
+ fabs(m_Matrix.d) < 0.5f) {
int dest_width = image_rect.Width();
int dest_height = image_rect.Height();
FX_RECT bitmap_clip = m_ClipBox;
diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp
index d8159aabb5..65f6bc8ec9 100644
--- a/core/fxge/dib/cfx_imagetransformer.cpp
+++ b/core/fxge/dib/cfx_imagetransformer.cpp
@@ -168,9 +168,9 @@ bool CFX_ImageTransformer::Start() {
return false;
m_result = result_clip;
- if (FXSYS_fabs(m_pMatrix->a) < FXSYS_fabs(m_pMatrix->b) / 20 &&
- FXSYS_fabs(m_pMatrix->d) < FXSYS_fabs(m_pMatrix->c) / 20 &&
- FXSYS_fabs(m_pMatrix->a) < 0.5f && FXSYS_fabs(m_pMatrix->d) < 0.5f) {
+ if (fabs(m_pMatrix->a) < fabs(m_pMatrix->b) / 20 &&
+ fabs(m_pMatrix->d) < fabs(m_pMatrix->c) / 20 &&
+ fabs(m_pMatrix->a) < 0.5f && fabs(m_pMatrix->d) < 0.5f) {
int dest_width = result_rect.Width();
int dest_height = result_rect.Height();
result_clip.Offset(-result_rect.left, -result_rect.top);
@@ -182,12 +182,11 @@ bool CFX_ImageTransformer::Start() {
m_Status = 1;
return true;
}
- if (FXSYS_fabs(m_pMatrix->b) < FIX16_005 &&
- FXSYS_fabs(m_pMatrix->c) < FIX16_005) {
- int dest_width = m_pMatrix->a > 0 ? (int)FXSYS_ceil(m_pMatrix->a)
- : (int)FXSYS_floor(m_pMatrix->a);
- int dest_height = m_pMatrix->d > 0 ? (int)-FXSYS_ceil(m_pMatrix->d)
- : (int)-FXSYS_floor(m_pMatrix->d);
+ if (fabs(m_pMatrix->b) < FIX16_005 && fabs(m_pMatrix->c) < FIX16_005) {
+ int dest_width =
+ m_pMatrix->a > 0 ? (int)ceil(m_pMatrix->a) : (int)floor(m_pMatrix->a);
+ int dest_height =
+ m_pMatrix->d > 0 ? (int)-ceil(m_pMatrix->d) : (int)-floor(m_pMatrix->d);
result_clip.Offset(-result_rect.left, -result_rect.top);
m_Stretcher = pdfium::MakeUnique<CFX_ImageStretcher>(
&m_Storer, m_pSrc, dest_width, dest_height, result_clip, m_Flags);
@@ -195,8 +194,8 @@ bool CFX_ImageTransformer::Start() {
m_Status = 2;
return true;
}
- int stretch_width = (int)FXSYS_ceil(FXSYS_sqrt2(m_pMatrix->a, m_pMatrix->b));
- int stretch_height = (int)FXSYS_ceil(FXSYS_sqrt2(m_pMatrix->c, m_pMatrix->d));
+ int stretch_width = (int)ceil(FXSYS_sqrt2(m_pMatrix->a, m_pMatrix->b));
+ int stretch_height = (int)ceil(FXSYS_sqrt2(m_pMatrix->c, m_pMatrix->d));
CFX_Matrix stretch2dest(1.0f, 0.0f, 0.0f, -1.0f, 0.0f,
(float)(stretch_height));
stretch2dest.Concat(
diff --git a/core/fxge/dib/fx_dib_engine.cpp b/core/fxge/dib/fx_dib_engine.cpp
index d304a56600..9a5a7c1351 100644
--- a/core/fxge/dib/fx_dib_engine.cpp
+++ b/core/fxge/dib/fx_dib_engine.cpp
@@ -40,9 +40,8 @@ bool CWeightTable::Calc(int dest_len,
const double scale = (float)src_len / (float)dest_len;
const double base = dest_len < 0 ? (float)(src_len) : 0;
const int ext_size = flags & FXDIB_BICUBIC_INTERPOL ? 3 : 1;
- m_ItemSize =
- sizeof(int) * 2 +
- (int)(sizeof(int) * (FXSYS_ceil(FXSYS_fabs((float)scale)) + ext_size));
+ m_ItemSize = sizeof(int) * 2 +
+ (int)(sizeof(int) * (ceil(fabs((float)scale)) + ext_size));
m_DestMin = dest_min;
if ((dest_max - dest_min) > (int)((1U << 30) - 4) / m_ItemSize)
return false;
@@ -52,13 +51,13 @@ bool CWeightTable::Calc(int dest_len,
if (!m_pWeightTables)
return false;
- if ((flags & FXDIB_NOSMOOTH) != 0 || FXSYS_fabs((float)scale) < 1.0f) {
+ if ((flags & FXDIB_NOSMOOTH) != 0 || 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 (flags & FXDIB_INTERPOL) {
- 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;
}
@@ -73,8 +72,8 @@ bool CWeightTable::Calc(int dest_len,
pixel_weights.m_Weights[0] = 65536 - pixel_weights.m_Weights[1];
}
} else if (flags & FXDIB_BICUBIC_INTERPOL) {
- 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);
int start = pixel_weights.m_SrcStart - 1;
int end = pixel_weights.m_SrcEnd + 1;
if (start < src_min) {
@@ -157,7 +156,7 @@ bool CWeightTable::Calc(int dest_len,
}
} else {
pixel_weights.m_SrcStart = pixel_weights.m_SrcEnd =
- (int)FXSYS_floor((float)src_pos);
+ (int)floor((float)src_pos);
if (pixel_weights.m_SrcStart < src_min) {
pixel_weights.m_SrcStart = src_min;
}
@@ -176,11 +175,11 @@ bool CWeightTable::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;
@@ -286,9 +285,9 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap,
m_SrcPitch = (m_SrcWidth * m_SrcBpp + 31) / 32 * 4;
if ((flags & FXDIB_NOSMOOTH) == 0) {
bool bInterpol = flags & FXDIB_INTERPOL || flags & FXDIB_BICUBIC_INTERPOL;
- if (!bInterpol && FXSYS_abs(dest_width) != 0 &&
- FXSYS_abs(dest_height) / 8 < static_cast<long long>(m_SrcWidth) *
- m_SrcHeight / FXSYS_abs(dest_width)) {
+ if (!bInterpol && abs(dest_width) != 0 &&
+ abs(dest_height) / 8 < static_cast<long long>(m_SrcWidth) *
+ m_SrcHeight / abs(dest_width)) {
flags = FXDIB_INTERPOL;
}
m_Flags = flags;
@@ -316,10 +315,10 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap,
src_top = src_bottom;
src_bottom = temp;
}
- m_SrcClip.left = (int)FXSYS_floor((float)src_left);
- m_SrcClip.right = (int)FXSYS_ceil((float)src_right);
- m_SrcClip.top = (int)FXSYS_floor((float)src_top);
- m_SrcClip.bottom = (int)FXSYS_ceil((float)src_bottom);
+ m_SrcClip.left = (int)floor((float)src_left);
+ m_SrcClip.right = (int)ceil((float)src_right);
+ m_SrcClip.top = (int)floor((float)src_top);
+ m_SrcClip.bottom = (int)ceil((float)src_bottom);
FX_RECT src_rect(0, 0, m_SrcWidth, m_SrcHeight);
m_SrcClip.Intersect(src_rect);
if (m_SrcBpp == 1) {
diff --git a/core/fxge/ge/cfx_facecache.cpp b/core/fxge/ge/cfx_facecache.cpp
index 4c44660426..0e9e40135a 100644
--- a/core/fxge/ge/cfx_facecache.cpp
+++ b/core/fxge/ge/cfx_facecache.cpp
@@ -55,7 +55,7 @@ void ContrastAdjust(uint8_t* pDataIn,
}
temp = max - min;
if (temp == 0 || temp == 255) {
- int rowbytes = std::min(FXSYS_abs(nSrcRowBytes), nDstRowBytes);
+ int rowbytes = std::min(abs(nSrcRowBytes), nDstRowBytes);
for (row = 0; row < nHeight; row++) {
FXSYS_memcpy(pDataOut + row * nDstRowBytes, pDataIn + row * nSrcRowBytes,
rowbytes);
@@ -165,8 +165,9 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(const CFX_Font* pFont,
else
level = CFX_Font::s_WeightPow_11[index];
- level = level * (FXSYS_abs(static_cast<int>(ft_matrix.xx)) +
- FXSYS_abs(static_cast<int>(ft_matrix.xy))) /
+ level = level *
+ (abs(static_cast<int>(ft_matrix.xx)) +
+ abs(static_cast<int>(ft_matrix.xy))) /
36655;
FXFT_Outline_Embolden(FXFT_Get_Glyph_Outline(m_Face),
level.ValueOrDefault(0));
@@ -209,8 +210,7 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(const CFX_Font* pFont,
if (anti_alias == FXFT_RENDER_MODE_MONO &&
FXFT_Get_Bitmap_PixelMode(FXFT_Get_Glyph_Bitmap(m_Face)) ==
FXFT_PIXEL_MODE_MONO) {
- int rowbytes =
- FXSYS_abs(src_pitch) > dest_pitch ? dest_pitch : FXSYS_abs(src_pitch);
+ int rowbytes = abs(src_pitch) > dest_pitch ? dest_pitch : abs(src_pitch);
for (int row = 0; row < bmheight; row++) {
FXSYS_memcpy(pDestBuf + row * dest_pitch, pSrcBuf + row * src_pitch,
rowbytes);
diff --git a/core/fxge/ge/cfx_fontmapper.cpp b/core/fxge/ge/cfx_fontmapper.cpp
index 622b457396..e04e581434 100644
--- a/core/fxge/ge/cfx_fontmapper.cpp
+++ b/core/fxge/ge/cfx_fontmapper.cpp
@@ -707,7 +707,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
if (bItalic && !FXFT_Is_Face_Italic(face)) {
if (italic_angle == 0)
italic_angle = -12;
- else if (FXSYS_abs(italic_angle) < 5)
+ else if (abs(italic_angle) < 5)
italic_angle = 0;
pSubstFont->m_ItalicAngle = italic_angle;
}
diff --git a/core/fxge/ge/cfx_pathdata.cpp b/core/fxge/ge/cfx_pathdata.cpp
index d4c657c3a4..75e4faf0ef 100644
--- a/core/fxge/ge/cfx_pathdata.cpp
+++ b/core/fxge/ge/cfx_pathdata.cpp
@@ -71,8 +71,8 @@ void UpdateLineJoinPoints(CFX_FloatRect* rect,
float end_dc = 0;
float one_twentieth = 1.0f / 20;
- bool bStartVert = FXSYS_fabs(start_pos.x - mid_pos.x) < one_twentieth;
- bool bEndVert = FXSYS_fabs(mid_pos.x - end_pos.x) < one_twentieth;
+ bool bStartVert = fabs(start_pos.x - mid_pos.x) < one_twentieth;
+ bool bEndVert = fabs(mid_pos.x - end_pos.x) < one_twentieth;
if (bStartVert && bEndVert) {
int start_dir = mid_pos.y > start_pos.y ? 1 : -1;
float point_y = mid_pos.y + half_width * start_dir;
@@ -87,15 +87,14 @@ void UpdateLineJoinPoints(CFX_FloatRect* rect,
start_c = mid_pos.y - (start_k * mid_pos.x);
start_len = FXSYS_sqrt2(start_to_mid.x, start_to_mid.y);
start_dc =
- static_cast<float>(FXSYS_fabs(half_width * start_len / start_to_mid.x));
+ static_cast<float>(fabs(half_width * start_len / start_to_mid.x));
}
if (!bEndVert) {
CFX_PointF end_to_mid = end_pos - mid_pos;
end_k = end_to_mid.y / end_to_mid.x;
end_c = mid_pos.y - (end_k * mid_pos.x);
end_len = FXSYS_sqrt2(end_to_mid.x, end_to_mid.y);
- end_dc =
- static_cast<float>(FXSYS_fabs(half_width * end_len / end_to_mid.x));
+ end_dc = static_cast<float>(fabs(half_width * end_len / end_to_mid.x));
}
if (bStartVert) {
CFX_PointF outside(start_pos.x, 0);
@@ -129,7 +128,7 @@ void UpdateLineJoinPoints(CFX_FloatRect* rect,
return;
}
- if (FXSYS_fabs(start_k - end_k) < one_twentieth) {
+ if (fabs(start_k - end_k) < one_twentieth) {
int start_dir = mid_pos.x > start_pos.x ? 1 : -1;
int end_dir = end_pos.x > mid_pos.x ? 1 : -1;
if (start_dir == end_dir)
@@ -360,8 +359,8 @@ bool CFX_PathData::GetZeroAreaPath(const CFX_Matrix* pMatrix,
(m_Points[i].m_Point.y - m_Points[next].m_Point.y) >
0)) {
int pre = i;
- if (FXSYS_fabs(m_Points[i].m_Point.y - m_Points[i - 1].m_Point.y) <
- FXSYS_fabs(m_Points[i].m_Point.y - m_Points[next].m_Point.y)) {
+ if (fabs(m_Points[i].m_Point.y - m_Points[i - 1].m_Point.y) <
+ fabs(m_Points[i].m_Point.y - m_Points[next].m_Point.y)) {
pre--;
next--;
}
@@ -375,8 +374,8 @@ bool CFX_PathData::GetZeroAreaPath(const CFX_Matrix* pMatrix,
(m_Points[i].m_Point.x - m_Points[next].m_Point.x) >
0)) {
int pre = i;
- if (FXSYS_fabs(m_Points[i].m_Point.x - m_Points[i - 1].m_Point.x) <
- FXSYS_fabs(m_Points[i].m_Point.x - m_Points[next].m_Point.x)) {
+ if (fabs(m_Points[i].m_Point.x - m_Points[i - 1].m_Point.x) <
+ fabs(m_Points[i].m_Point.x - m_Points[next].m_Point.x)) {
pre--;
next--;
}
diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp
index 782dbf3e2f..521ba4c65d 100644
--- a/core/fxge/ge/cfx_renderdevice.cpp
+++ b/core/fxge/ge/cfx_renderdevice.cpp
@@ -43,7 +43,7 @@ void AdjustGlyphSpace(std::vector<FXTEXT_GLYPHPOS>* pGlyphAndPos) {
int space = next_origin - current_origin;
float space_f = next_origin_f - current_origin_f;
- float error = FXSYS_fabs(space_f) - FXSYS_fabs(static_cast<float>(space));
+ float error = fabs(space_f) - fabs(static_cast<float>(space));
if (error > 0.5f)
current_origin += space > 0 ? -1 : 1;
}
@@ -513,13 +513,13 @@ bool CFX_RenderDevice::DrawPathWithBlend(const CFX_PathData* pPathData,
if (!rect_i.Valid())
return false;
- int width = (int)FXSYS_ceil(rect_f.right - rect_f.left);
+ int width = (int)ceil(rect_f.right - rect_f.left);
if (width < 1) {
width = 1;
if (rect_i.left == rect_i.right)
rect_i.right++;
}
- int height = (int)FXSYS_ceil(rect_f.top - rect_f.bottom);
+ int height = (int)ceil(rect_f.top - rect_f.bottom);
if (height < 1) {
height = 1;
if (rect_i.bottom == rect_i.top)
@@ -608,8 +608,8 @@ bool CFX_RenderDevice::DrawFillStrokePath(const CFX_PathData* pPathData,
pObject2Device->TransformRect(bbox);
CFX_Matrix ctm = GetCTM();
- float fScaleX = FXSYS_fabs(ctm.a);
- float fScaleY = FXSYS_fabs(ctm.d);
+ float fScaleX = fabs(ctm.a);
+ float fScaleY = fabs(ctm.d);
FX_RECT rect = bbox.GetOuterRect();
auto bitmap = pdfium::MakeRetain<CFX_DIBitmap>();
auto Backdrop = pdfium::MakeRetain<CFX_DIBitmap>();
@@ -719,8 +719,8 @@ bool CFX_RenderDevice::SetDIBitsWithBlend(
int blend_mode) {
ASSERT(!pBitmap->IsAlphaMask());
CFX_Matrix ctm = GetCTM();
- float fScaleX = FXSYS_fabs(ctm.a);
- float fScaleY = FXSYS_fabs(ctm.d);
+ float fScaleX = fabs(ctm.a);
+ float fScaleY = fabs(ctm.d);
FX_RECT dest_rect(left, top,
FXSYS_round(left + pBitmap->GetWidth() / fScaleX),
FXSYS_round(top + pBitmap->GetHeight() / fScaleY));
@@ -889,7 +889,7 @@ bool CFX_RenderDevice::DrawNormalText(int nChars,
}
char2device.Scale(font_size, -font_size);
- if (FXSYS_fabs(char2device.a) + FXSYS_fabs(char2device.b) > 50 * 1.0f ||
+ if (fabs(char2device.a) + fabs(char2device.b) > 50 * 1.0f ||
((m_DeviceClass == FXDC_PRINTER) &&
!(text_flags & FXTEXT_PRINTIMAGETEXT))) {
if (pFont->GetFace()) {
@@ -927,8 +927,8 @@ bool CFX_RenderDevice::DrawNormalText(int nChars,
}
std::vector<FXTEXT_GLYPHPOS> glyphs(nChars);
CFX_Matrix matrixCTM = GetCTM();
- float scale_x = FXSYS_fabs(matrixCTM.a);
- float scale_y = FXSYS_fabs(matrixCTM.d);
+ float scale_x = fabs(matrixCTM.a);
+ float scale_y = fabs(matrixCTM.d);
CFX_Matrix deviceCtm = char2device;
CFX_Matrix m(scale_x, 0, 0, scale_y, 0, 0);
deviceCtm.Concat(m);
@@ -942,7 +942,7 @@ bool CFX_RenderDevice::DrawNormalText(int nChars,
if (anti_alias < FXFT_RENDER_MODE_LCD)
glyph.m_Origin.x = FXSYS_round(glyph.m_fOrigin.x);
else
- glyph.m_Origin.x = static_cast<int>(FXSYS_floor(glyph.m_fOrigin.x));
+ glyph.m_Origin.x = static_cast<int>(floor(glyph.m_fOrigin.x));
glyph.m_Origin.y = FXSYS_round(glyph.m_fOrigin.y);
if (charpos.m_bGlyphAdjust) {
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<const DWORD*>(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<CFX_DIBSource>& 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<CFX_DIBSource>& 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<CFX_DIBitmap> pTransformed =