diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-03-14 14:43:42 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-14 19:05:58 +0000 |
commit | 05df075154a832fcb476e1dfcfb865722d0ea898 (patch) | |
tree | b8b771b62adae74d5d5ee561db75d10de3a848bf /core/fpdfapi/render | |
parent | 6b94f01d1c8ad386d497428c7397b1a99614aeba (diff) | |
download | pdfium-05df075154a832fcb476e1dfcfb865722d0ea898.tar.xz |
Replace FX_FLOAT with underlying float type.
Change-Id: I158b7d80b0ec28b742a9f2d5a96f3dde7fb3ab56
Reviewed-on: https://pdfium-review.googlesource.com/3031
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r-- | core/fpdfapi/render/cpdf_charposlist.cpp | 4 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_charposlist.h | 4 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_devicebuffer.cpp | 4 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_dibsource.cpp | 41 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_dibsource.h | 4 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_docrenderdata.cpp | 6 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_imagerenderer.cpp | 2 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_renderstatus.cpp | 211 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_renderstatus.h | 2 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp | 4 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_textrenderer.cpp | 18 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_textrenderer.h | 14 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_type3cache.cpp | 14 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_type3cache.h | 8 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_type3glyphs.cpp | 10 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_type3glyphs.h | 5 |
16 files changed, 173 insertions, 178 deletions
diff --git a/core/fpdfapi/render/cpdf_charposlist.cpp b/core/fpdfapi/render/cpdf_charposlist.cpp index 639bdcf17b..6d4540e163 100644 --- a/core/fpdfapi/render/cpdf_charposlist.cpp +++ b/core/fpdfapi/render/cpdf_charposlist.cpp @@ -20,9 +20,9 @@ CPDF_CharPosList::~CPDF_CharPosList() { } void CPDF_CharPosList::Load(const std::vector<uint32_t>& charCodes, - const std::vector<FX_FLOAT>& charPos, + const std::vector<float>& charPos, CPDF_Font* pFont, - FX_FLOAT FontSize) { + float FontSize) { int nChars = pdfium::CollectionSize<int>(charCodes); m_pCharPos = FX_Alloc(FXTEXT_CHARPOS, nChars); m_nChars = 0; diff --git a/core/fpdfapi/render/cpdf_charposlist.h b/core/fpdfapi/render/cpdf_charposlist.h index 2f5a44dfa0..c4636bca51 100644 --- a/core/fpdfapi/render/cpdf_charposlist.h +++ b/core/fpdfapi/render/cpdf_charposlist.h @@ -19,9 +19,9 @@ class CPDF_CharPosList { CPDF_CharPosList(); ~CPDF_CharPosList(); void Load(const std::vector<uint32_t>& charCodes, - const std::vector<FX_FLOAT>& charPos, + const std::vector<float>& charPos, CPDF_Font* pFont, - FX_FLOAT font_size); + float font_size); FXTEXT_CHARPOS* m_pCharPos; uint32_t m_nChars; }; diff --git a/core/fpdfapi/render/cpdf_devicebuffer.cpp b/core/fpdfapi/render/cpdf_devicebuffer.cpp index dec13433e4..b8c174d97e 100644 --- a/core/fpdfapi/render/cpdf_devicebuffer.cpp +++ b/core/fpdfapi/render/cpdf_devicebuffer.cpp @@ -38,9 +38,9 @@ bool CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, int dpiv = pDevice->GetDeviceCaps(FXDC_PIXEL_HEIGHT) * 254 / (vert_size * 10); if (dpih > max_dpi) - m_Matrix.Scale((FX_FLOAT)(max_dpi) / dpih, 1.0f); + m_Matrix.Scale((float)(max_dpi) / dpih, 1.0f); if (dpiv > max_dpi) - m_Matrix.Scale(1.0f, (FX_FLOAT)(max_dpi) / (FX_FLOAT)dpiv); + m_Matrix.Scale(1.0f, (float)(max_dpi) / (float)dpiv); } #endif CFX_Matrix ctm = m_pDevice->GetCTM(); diff --git a/core/fpdfapi/render/cpdf_dibsource.cpp b/core/fpdfapi/render/cpdf_dibsource.cpp index 33a8d930a5..403866300d 100644 --- a/core/fpdfapi/render/cpdf_dibsource.cpp +++ b/core/fpdfapi/render/cpdf_dibsource.cpp @@ -452,11 +452,11 @@ DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(bool& bDefaultDecode, if (pDecode) { for (uint32_t i = 0; i < m_nComponents; i++) { pCompData[i].m_DecodeMin = pDecode->GetNumberAt(i * 2); - FX_FLOAT max = pDecode->GetNumberAt(i * 2 + 1); + float max = pDecode->GetNumberAt(i * 2 + 1); pCompData[i].m_DecodeStep = (max - pCompData[i].m_DecodeMin) / max_data; - FX_FLOAT def_value; - FX_FLOAT def_min; - FX_FLOAT def_max; + float def_value; + float def_min; + float def_max; m_pColorSpace->GetDefaultValue(i, def_value, def_min, def_max); if (m_Family == PDFCS_INDEXED) { def_max = max_data; @@ -467,7 +467,7 @@ DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(bool& bDefaultDecode, } } else { for (uint32_t i = 0; i < m_nComponents; i++) { - FX_FLOAT def_value; + float def_value; m_pColorSpace->GetDefaultValue(i, def_value, pCompData[i].m_DecodeMin, pCompData[i].m_DecodeStep); if (m_Family == PDFCS_INDEXED) { @@ -699,8 +699,8 @@ int CPDF_DIBSource::StratLoadMask() { CPDF_Array* pMatte = m_pMaskStream->GetDict()->GetArrayFor("Matte"); if (pMatte && m_pColorSpace && m_pColorSpace->CountComponents() <= m_nComponents) { - FX_FLOAT R, G, B; - std::vector<FX_FLOAT> colors(m_nComponents); + float R, G, B; + std::vector<float> colors(m_nComponents); for (uint32_t i = 0; i < m_nComponents; i++) { colors[i] = pMatte->GetFloatAt(i); } @@ -775,10 +775,10 @@ void CPDF_DIBSource::LoadPalette() { if (m_pColorSpace->CountComponents() > 3) { return; } - FX_FLOAT color_values[3]; + float color_values[3]; color_values[0] = m_pCompData[0].m_DecodeMin; color_values[1] = color_values[2] = color_values[0]; - FX_FLOAT R = 0.0f, G = 0.0f, B = 0.0f; + float R = 0.0f, G = 0.0f, B = 0.0f; m_pColorSpace->GetRGB(color_values, R, G, B); FX_ARGB argb0 = ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255)); @@ -798,8 +798,8 @@ void CPDF_DIBSource::LoadPalette() { m_bpc == 8 && m_bDefaultDecode) { } else { int palette_count = 1 << (m_bpc * m_nComponents); - CFX_FixedBufGrow<FX_FLOAT, 16> color_values(m_nComponents); - FX_FLOAT* color_value = color_values; + CFX_FixedBufGrow<float, 16> color_values(m_nComponents); + float* color_value = color_values; for (int i = 0; i < palette_count; i++) { int color_data = i; for (uint32_t j = 0; j < m_nComponents; j++) { @@ -808,11 +808,11 @@ void CPDF_DIBSource::LoadPalette() { color_value[j] = m_pCompData[j].m_DecodeMin + m_pCompData[j].m_DecodeStep * encoded_component; } - FX_FLOAT R = 0, G = 0, B = 0; + float R = 0, G = 0, B = 0; if (m_nComponents == 1 && m_Family == PDFCS_ICCBASED && m_pColorSpace->CountComponents() > 1) { int nComponents = m_pColorSpace->CountComponents(); - std::vector<FX_FLOAT> temp_buf(nComponents); + std::vector<float> temp_buf(nComponents); for (int k = 0; k < nComponents; k++) { temp_buf[k] = *color_value; } @@ -917,9 +917,9 @@ void CPDF_DIBSource::TranslateScanline24bpp(uint8_t* dest_scan, return; } } - CFX_FixedBufGrow<FX_FLOAT, 16> color_values1(m_nComponents); - FX_FLOAT* color_values = color_values1; - FX_FLOAT R = 0.0f, G = 0.0f, B = 0.0f; + CFX_FixedBufGrow<float, 16> color_values1(m_nComponents); + float* color_values = color_values1; + float R = 0.0f, G = 0.0f, B = 0.0f; if (m_bpc == 8) { uint64_t src_byte_pos = 0; size_t dest_byte_pos = 0; @@ -930,7 +930,7 @@ void CPDF_DIBSource::TranslateScanline24bpp(uint8_t* dest_scan, m_pCompData[color].m_DecodeStep * data; } if (TransMask()) { - FX_FLOAT k = 1.0f - color_values[3]; + float k = 1.0f - color_values[3]; R = (1.0f - color_values[0]) * k; G = (1.0f - color_values[1]) * k; B = (1.0f - color_values[2]) * k; @@ -956,7 +956,7 @@ void CPDF_DIBSource::TranslateScanline24bpp(uint8_t* dest_scan, src_bit_pos += m_bpc; } if (TransMask()) { - FX_FLOAT k = 1.0f - color_values[3]; + float k = 1.0f - color_values[3]; R = (1.0f - color_values[0]) * k; G = (1.0f - color_values[1]) * k; B = (1.0f - color_values[2]) * k; @@ -1332,7 +1332,7 @@ void CPDF_DIBSource::DownSampleScanline32Bit(int orig_Bpp, // in [0, src_width). Set the initial value to be an invalid src_x value. uint32_t last_src_x = src_width; FX_ARGB last_argb = FXARGB_MAKE(0xFF, 0xFF, 0xFF, 0xFF); - FX_FLOAT unit_To8Bpc = 255.0f / ((1 << m_bpc) - 1); + float unit_To8Bpc = 255.0f / ((1 << m_bpc) - 1); for (int i = 0; i < clip_width; i++) { int dest_x = clip_left + i; uint32_t src_x = (bFlipX ? (dest_width - dest_x - 1) : dest_x) * @@ -1376,8 +1376,7 @@ void CPDF_DIBSource::DownSampleScanline32Bit(int orig_Bpp, bTransMask); } else { for (uint32_t j = 0; j < m_nComponents; ++j) { - FX_FLOAT component_value = - static_cast<FX_FLOAT>(extracted_components[j]); + float component_value = static_cast<float>(extracted_components[j]); int color_value = static_cast<int>( (m_pCompData[j].m_DecodeMin + m_pCompData[j].m_DecodeStep * component_value) * diff --git a/core/fpdfapi/render/cpdf_dibsource.h b/core/fpdfapi/render/cpdf_dibsource.h index d5820d8bae..766025db7a 100644 --- a/core/fpdfapi/render/cpdf_dibsource.h +++ b/core/fpdfapi/render/cpdf_dibsource.h @@ -29,8 +29,8 @@ class CPDF_Document; class CPDF_Stream; typedef struct { - FX_FLOAT m_DecodeMin; - FX_FLOAT m_DecodeStep; + float m_DecodeMin; + float m_DecodeStep; int m_ColorKeyMin; int m_ColorKeyMax; } DIB_COMP_DATA; diff --git a/core/fpdfapi/render/cpdf_docrenderdata.cpp b/core/fpdfapi/render/cpdf_docrenderdata.cpp index 0e6f2d07e5..a6488c64d8 100644 --- a/core/fpdfapi/render/cpdf_docrenderdata.cpp +++ b/core/fpdfapi/render/cpdf_docrenderdata.cpp @@ -109,12 +109,12 @@ CPDF_TransferFunc* CPDF_DocRenderData::GetTransferFunc(CPDF_Object* pObj) { pdfium::MakeUnique<CPDF_TransferFunc>(m_pPDFDoc)); CPDF_TransferFunc* pTransfer = pTransferCounter->get(); m_TransferFuncMap[pObj] = pTransferCounter; - FX_FLOAT output[kMaxOutputs]; + float output[kMaxOutputs]; FXSYS_memset(output, 0, sizeof(output)); - FX_FLOAT input; + float input; int noutput; for (int v = 0; v < 256; ++v) { - input = (FX_FLOAT)v / 255.0f; + input = (float)v / 255.0f; if (bUniTransfer) { if (pFuncs[0] && pFuncs[0]->CountOutputs() <= kMaxOutputs) pFuncs[0]->Call(&input, 1, output, noutput); diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp index 358d13edd0..7903ad4a62 100644 --- a/core/fpdfapi/render/cpdf_imagerenderer.cpp +++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp @@ -305,7 +305,7 @@ bool CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device) { &m_pRenderStatus->m_Options, 0, m_pRenderStatus->m_bDropObjects, nullptr, true); CFX_Matrix patternDevice = *pObj2Device; - patternDevice.Translate((FX_FLOAT)-rect.left, (FX_FLOAT)-rect.top); + patternDevice.Translate((float)-rect.left, (float)-rect.top); if (CPDF_TilingPattern* pTilingPattern = m_pPattern->AsTilingPattern()) { bitmap_render.DrawTilingPattern(pTilingPattern, m_pImageObject, &patternDevice, false); diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index 682e6c0c91..28c7166013 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -108,12 +108,12 @@ void DrawAxialShading(CFX_DIBitmap* pBitmap, if (!pCoords) return; - FX_FLOAT start_x = pCoords->GetNumberAt(0); - FX_FLOAT start_y = pCoords->GetNumberAt(1); - FX_FLOAT end_x = pCoords->GetNumberAt(2); - FX_FLOAT end_y = pCoords->GetNumberAt(3); - FX_FLOAT t_min = 0; - FX_FLOAT t_max = 1.0f; + float start_x = pCoords->GetNumberAt(0); + float start_y = pCoords->GetNumberAt(1); + float end_x = pCoords->GetNumberAt(2); + float end_y = pCoords->GetNumberAt(3); + float t_min = 0; + float t_max = 1.0f; CPDF_Array* pArray = pDict->GetArrayFor("Domain"); if (pArray) { t_min = pArray->GetNumberAt(0); @@ -128,19 +128,19 @@ void DrawAxialShading(CFX_DIBitmap* pBitmap, } int width = pBitmap->GetWidth(); int height = pBitmap->GetHeight(); - FX_FLOAT x_span = end_x - start_x; - FX_FLOAT y_span = end_y - start_y; - FX_FLOAT axis_len_square = (x_span * x_span) + (y_span * y_span); + float x_span = end_x - start_x; + float y_span = end_y - start_y; + float axis_len_square = (x_span * x_span) + (y_span * y_span); CFX_Matrix matrix; matrix.SetReverse(*pObject2Bitmap); uint32_t total_results = std::max(CountOutputs(funcs), pCS->CountComponents()); - CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results); - FX_FLOAT* pResults = result_array; - FXSYS_memset(pResults, 0, total_results * sizeof(FX_FLOAT)); + CFX_FixedBufGrow<float, 16> result_array(total_results); + float* pResults = result_array; + FXSYS_memset(pResults, 0, total_results * sizeof(float)); uint32_t rgb_array[SHADING_STEPS]; for (int i = 0; i < SHADING_STEPS; i++) { - FX_FLOAT input = (t_max - t_min) * i / SHADING_STEPS + t_min; + float input = (t_max - t_min) * i / SHADING_STEPS + t_min; int offset = 0; for (const auto& func : funcs) { if (func) { @@ -149,7 +149,7 @@ void DrawAxialShading(CFX_DIBitmap* pBitmap, offset += nresults; } } - FX_FLOAT R = 0.0f, G = 0.0f, B = 0.0f; + float R = 0.0f, G = 0.0f, B = 0.0f; pCS->GetRGB(pResults, R, G, B); rgb_array[i] = FXARGB_TODIB(FXARGB_MAKE(alpha, FXSYS_round(R * 255), @@ -159,9 +159,9 @@ void DrawAxialShading(CFX_DIBitmap* pBitmap, for (int row = 0; row < height; row++) { uint32_t* dib_buf = (uint32_t*)(pBitmap->GetBuffer() + row * pitch); for (int column = 0; column < width; column++) { - CFX_PointF pos = matrix.Transform(CFX_PointF( - static_cast<FX_FLOAT>(column), static_cast<FX_FLOAT>(row))); - FX_FLOAT scale = + CFX_PointF pos = matrix.Transform( + CFX_PointF(static_cast<float>(column), static_cast<float>(row))); + float scale = (((pos.x - start_x) * x_span) + ((pos.y - start_y) * y_span)) / axis_len_square; int index = (int32_t)(scale * (SHADING_STEPS - 1)); @@ -192,16 +192,16 @@ void DrawRadialShading(CFX_DIBitmap* pBitmap, if (!pCoords) return; - FX_FLOAT start_x = pCoords->GetNumberAt(0); - FX_FLOAT start_y = pCoords->GetNumberAt(1); - FX_FLOAT start_r = pCoords->GetNumberAt(2); - FX_FLOAT end_x = pCoords->GetNumberAt(3); - FX_FLOAT end_y = pCoords->GetNumberAt(4); - FX_FLOAT end_r = pCoords->GetNumberAt(5); + float start_x = pCoords->GetNumberAt(0); + float start_y = pCoords->GetNumberAt(1); + float start_r = pCoords->GetNumberAt(2); + float end_x = pCoords->GetNumberAt(3); + float end_y = pCoords->GetNumberAt(4); + float end_r = pCoords->GetNumberAt(5); CFX_Matrix matrix; matrix.SetReverse(*pObject2Bitmap); - FX_FLOAT t_min = 0; - FX_FLOAT t_max = 1.0f; + float t_min = 0; + float t_max = 1.0f; CPDF_Array* pArray = pDict->GetArrayFor("Domain"); if (pArray) { t_min = pArray->GetNumberAt(0); @@ -216,12 +216,12 @@ void DrawRadialShading(CFX_DIBitmap* pBitmap, } uint32_t total_results = std::max(CountOutputs(funcs), pCS->CountComponents()); - CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results); - FX_FLOAT* pResults = result_array; - FXSYS_memset(pResults, 0, total_results * sizeof(FX_FLOAT)); + CFX_FixedBufGrow<float, 16> result_array(total_results); + float* pResults = result_array; + FXSYS_memset(pResults, 0, total_results * sizeof(float)); uint32_t rgb_array[SHADING_STEPS]; for (int i = 0; i < SHADING_STEPS; i++) { - FX_FLOAT input = (t_max - t_min) * i / SHADING_STEPS + t_min; + float input = (t_max - t_min) * i / SHADING_STEPS + t_min; int offset = 0; for (const auto& func : funcs) { if (func) { @@ -230,15 +230,15 @@ void DrawRadialShading(CFX_DIBitmap* pBitmap, offset += nresults; } } - FX_FLOAT R = 0.0f, G = 0.0f, B = 0.0f; + float R = 0.0f, G = 0.0f, B = 0.0f; pCS->GetRGB(pResults, R, G, B); rgb_array[i] = FXARGB_TODIB(FXARGB_MAKE(alpha, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255))); } - FX_FLOAT a = ((start_x - end_x) * (start_x - end_x)) + - ((start_y - end_y) * (start_y - end_y)) - - ((start_r - end_r) * (start_r - end_r)); + float a = ((start_x - end_x) * (start_x - end_x)) + + ((start_y - end_y) * (start_y - end_y)) - + ((start_r - end_r) * (start_r - end_r)); int width = pBitmap->GetWidth(); int height = pBitmap->GetHeight(); int pitch = pBitmap->GetPitch(); @@ -253,24 +253,23 @@ void DrawRadialShading(CFX_DIBitmap* pBitmap, for (int row = 0; row < height; row++) { uint32_t* dib_buf = (uint32_t*)(pBitmap->GetBuffer() + row * pitch); for (int column = 0; column < width; column++) { - CFX_PointF pos = matrix.Transform(CFX_PointF( - static_cast<FX_FLOAT>(column), static_cast<FX_FLOAT>(row))); - FX_FLOAT b = -2 * (((pos.x - start_x) * (end_x - start_x)) + - ((pos.y - start_y) * (end_y - start_y)) + - (start_r * (end_r - start_r))); - FX_FLOAT c = ((pos.x - start_x) * (pos.x - start_x)) + - ((pos.y - start_y) * (pos.y - start_y)) - - (start_r * start_r); - FX_FLOAT s; + CFX_PointF pos = matrix.Transform( + CFX_PointF(static_cast<float>(column), static_cast<float>(row))); + float b = -2 * (((pos.x - start_x) * (end_x - start_x)) + + ((pos.y - start_y) * (end_y - start_y)) + + (start_r * (end_r - start_r))); + float c = ((pos.x - start_x) * (pos.x - start_x)) + + ((pos.y - start_y) * (pos.y - start_y)) - (start_r * start_r); + float s; if (a == 0) { s = -c / b; } else { - FX_FLOAT b2_4ac = (b * b) - 4 * (a * c); + float b2_4ac = (b * b) - 4 * (a * c); if (b2_4ac < 0) { continue; } - FX_FLOAT root = FXSYS_sqrt(b2_4ac); - FX_FLOAT s1, s2; + float root = FXSYS_sqrt(b2_4ac); + float s1, s2; if (a > 0) { s1 = (-b - root) / (2 * a); s2 = (-b + root) / (2 * a); @@ -321,7 +320,7 @@ void DrawFuncShading(CFX_DIBitmap* pBitmap, int alpha) { ASSERT(pBitmap->GetFormat() == FXDIB_Argb); CPDF_Array* pDomain = pDict->GetArrayFor("Domain"); - FX_FLOAT xmin = 0, ymin = 0, xmax = 1.0f, ymax = 1.0f; + float xmin = 0, ymin = 0, xmax = 1.0f, ymax = 1.0f; if (pDomain) { xmin = pDomain->GetNumberAt(0); xmax = pDomain->GetNumberAt(1); @@ -340,18 +339,18 @@ void DrawFuncShading(CFX_DIBitmap* pBitmap, int pitch = pBitmap->GetPitch(); uint32_t total_results = std::max(CountOutputs(funcs), pCS->CountComponents()); - CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results); - FX_FLOAT* pResults = result_array; - FXSYS_memset(pResults, 0, total_results * sizeof(FX_FLOAT)); + CFX_FixedBufGrow<float, 16> result_array(total_results); + float* pResults = result_array; + FXSYS_memset(pResults, 0, total_results * sizeof(float)); for (int row = 0; row < height; row++) { uint32_t* dib_buf = (uint32_t*)(pBitmap->GetBuffer() + row * pitch); for (int column = 0; column < width; column++) { - CFX_PointF pos = matrix.Transform(CFX_PointF( - static_cast<FX_FLOAT>(column), static_cast<FX_FLOAT>(row))); + CFX_PointF pos = matrix.Transform( + CFX_PointF(static_cast<float>(column), static_cast<float>(row))); if (pos.x < xmin || pos.x > xmax || pos.y < ymin || pos.y > ymax) continue; - FX_FLOAT input[] = {pos.x, pos.y}; + float input[] = {pos.x, pos.y}; int offset = 0; for (const auto& func : funcs) { if (func) { @@ -361,9 +360,9 @@ void DrawFuncShading(CFX_DIBitmap* pBitmap, } } - FX_FLOAT R = 0.0f; - FX_FLOAT G = 0.0f; - FX_FLOAT B = 0.0f; + float R = 0.0f; + float G = 0.0f; + float B = 0.0f; pCS->GetRGB(pResults, R, G, B); dib_buf[column] = FXARGB_TODIB(FXARGB_MAKE( alpha, (int32_t)(R * 255), (int32_t)(G * 255), (int32_t)(B * 255))); @@ -374,7 +373,7 @@ void DrawFuncShading(CFX_DIBitmap* pBitmap, bool GetScanlineIntersect(int y, const CFX_PointF& first, const CFX_PointF& second, - FX_FLOAT* x) { + float* x) { if (first.y == second.y) return false; @@ -391,8 +390,8 @@ bool GetScanlineIntersect(int y, void DrawGouraud(CFX_DIBitmap* pBitmap, int alpha, CPDF_MeshVertex triangle[3]) { - FX_FLOAT min_y = triangle[0].position.y; - FX_FLOAT max_y = triangle[0].position.y; + float min_y = triangle[0].position.y; + float max_y = triangle[0].position.y; for (int i = 1; i < 3; i++) { min_y = std::min(min_y, triangle[i].position.y); max_y = std::max(max_y, triangle[i].position.y); @@ -408,10 +407,10 @@ void DrawGouraud(CFX_DIBitmap* pBitmap, for (int y = min_yi; y <= max_yi; y++) { int nIntersects = 0; - FX_FLOAT inter_x[3]; - FX_FLOAT r[3]; - FX_FLOAT g[3]; - FX_FLOAT b[3]; + float inter_x[3]; + float r[3]; + float g[3]; + float b[3]; for (int i = 0; i < 3; i++) { CPDF_MeshVertex& vertex1 = triangle[i]; CPDF_MeshVertex& vertex2 = triangle[(i + 1) % 3]; @@ -422,7 +421,7 @@ void DrawGouraud(CFX_DIBitmap* pBitmap, if (!bIntersect) continue; - FX_FLOAT y_dist = (y - position1.y) / (position2.y - position1.y); + float y_dist = (y - position1.y) / (position2.y - position1.y); r[nIntersects] = vertex1.r + ((vertex2.r - vertex1.r) * y_dist); g[nIntersects] = vertex1.g + ((vertex2.g - vertex1.g) * y_dist); b[nIntersects] = vertex1.b + ((vertex2.b - vertex1.b) * y_dist); @@ -451,12 +450,12 @@ void DrawGouraud(CFX_DIBitmap* pBitmap, uint8_t* dib_buf = pBitmap->GetBuffer() + y * pBitmap->GetPitch() + start_x * 4; - FX_FLOAT r_unit = (r[end_index] - r[start_index]) / (max_x - min_x); - FX_FLOAT g_unit = (g[end_index] - g[start_index]) / (max_x - min_x); - FX_FLOAT b_unit = (b[end_index] - b[start_index]) / (max_x - min_x); - FX_FLOAT R = r[start_index] + (start_x - min_x) * r_unit; - FX_FLOAT G = g[start_index] + (start_x - min_x) * g_unit; - FX_FLOAT B = b[start_index] + (start_x - min_x) * b_unit; + float r_unit = (r[end_index] - r[start_index]) / (max_x - min_x); + float g_unit = (g[end_index] - g[start_index]) / (max_x - min_x); + float b_unit = (b[end_index] - b[start_index]) / (max_x - min_x); + float R = r[start_index] + (start_x - min_x) * r_unit; + float G = g[start_index] + (start_x - min_x) * g_unit; + float B = b[start_index] + (start_x - min_x) * b_unit; for (int x = start_x; x < end_x; x++) { R += r_unit; G += g_unit; @@ -862,9 +861,9 @@ void DrawCoonPatchMeshes( if (!stream.CanReadColor()) break; - FX_FLOAT r; - FX_FLOAT g; - FX_FLOAT b; + float r; + float g; + float b; std::tie(r, g, b) = stream.ReadColor(); patch.patch_colors[i].comp[0] = (int32_t)(r * 255); @@ -872,8 +871,8 @@ void DrawCoonPatchMeshes( patch.patch_colors[i].comp[2] = (int32_t)(b * 255); } CFX_FloatRect bbox = CFX_FloatRect::GetBBox(coords, point_count); - if (bbox.right <= 0 || bbox.left >= (FX_FLOAT)pBitmap->GetWidth() || - bbox.top <= 0 || bbox.bottom >= (FX_FLOAT)pBitmap->GetHeight()) { + if (bbox.right <= 0 || bbox.left >= (float)pBitmap->GetWidth() || + bbox.top <= 0 || bbox.bottom >= (float)pBitmap->GetHeight()) { continue; } Coon_Bezier C1, C2, D1, D2; @@ -908,7 +907,7 @@ std::unique_ptr<CFX_DIBitmap> DrawPatternBitmap( CFX_FloatRect cell_bbox = pPattern->bbox(); pPattern->pattern_to_form()->TransformRect(cell_bbox); pObject2Device->TransformRect(cell_bbox); - CFX_FloatRect bitmap_rect(0.0f, 0.0f, (FX_FLOAT)width, (FX_FLOAT)height); + CFX_FloatRect bitmap_rect(0.0f, 0.0f, (float)width, (float)height); CFX_Matrix mtAdjust; mtAdjust.MatchRect(bitmap_rect, cell_bbox); @@ -1128,15 +1127,15 @@ bool CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj, FX_RECT rtClip = m_pDevice->GetClipBox(); if (!bLogical) { CFX_Matrix dCTM = m_pDevice->GetCTM(); - FX_FLOAT a = FXSYS_fabs(dCTM.a); - FX_FLOAT d = FXSYS_fabs(dCTM.d); + float a = FXSYS_fabs(dCTM.a); + float d = FXSYS_fabs(dCTM.d); if (a != 1.0f || d != 1.0f) { - rect.right = rect.left + (int32_t)FXSYS_ceil((FX_FLOAT)rect.Width() * a); - rect.bottom = rect.top + (int32_t)FXSYS_ceil((FX_FLOAT)rect.Height() * d); + rect.right = rect.left + (int32_t)FXSYS_ceil((float)rect.Width() * a); + rect.bottom = rect.top + (int32_t)FXSYS_ceil((float)rect.Height() * d); rtClip.right = - rtClip.left + (int32_t)FXSYS_ceil((FX_FLOAT)rtClip.Width() * a); + rtClip.left + (int32_t)FXSYS_ceil((float)rtClip.Width() * a); rtClip.bottom = - rtClip.top + (int32_t)FXSYS_ceil((FX_FLOAT)rtClip.Height() * d); + rtClip.top + (int32_t)FXSYS_ceil((float)rtClip.Height() * d); } } rect.Intersect(rtClip); @@ -1462,7 +1461,7 @@ bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj, } } CPDF_Dictionary* pFormResource = nullptr; - FX_FLOAT group_alpha = 1.0f; + float group_alpha = 1.0f; int Transparency = m_Transparency; bool bGroupTransparent = false; if (pPageObj->IsForm()) { @@ -1532,10 +1531,10 @@ bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj, return true; } CFX_Matrix deviceCTM = m_pDevice->GetCTM(); - FX_FLOAT scaleX = FXSYS_fabs(deviceCTM.a); - FX_FLOAT scaleY = FXSYS_fabs(deviceCTM.d); - int width = FXSYS_round((FX_FLOAT)rect.Width() * scaleX); - int height = FXSYS_round((FX_FLOAT)rect.Height() * scaleY); + float scaleX = FXSYS_fabs(deviceCTM.a); + float scaleY = FXSYS_fabs(deviceCTM.d); + int width = FXSYS_round((float)rect.Width() * scaleX); + int height = FXSYS_round((float)rect.Height() * scaleY); CFX_FxgeDevice bitmap_device; std::unique_ptr<CFX_DIBitmap> oriDevice; if (!isolated && (m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) { @@ -1626,8 +1625,8 @@ std::unique_ptr<CFX_DIBitmap> CPDF_RenderStatus::GetBackdrop( left = bbox.left; top = bbox.top; CFX_Matrix deviceCTM = m_pDevice->GetCTM(); - FX_FLOAT scaleX = FXSYS_fabs(deviceCTM.a); - FX_FLOAT scaleY = FXSYS_fabs(deviceCTM.d); + float scaleX = FXSYS_fabs(deviceCTM.a); + float scaleY = FXSYS_fabs(deviceCTM.d); int width = FXSYS_round(bbox.Width() * scaleX); int height = FXSYS_round(bbox.Height() * scaleY); auto pBackdrop = pdfium::MakeUnique<CFX_DIBitmap>(); @@ -1753,7 +1752,7 @@ bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj, if (!IsAvailableMatrix(text_matrix)) return true; - FX_FLOAT font_size = textobj->m_TextState.GetFontSize(); + float font_size = textobj->m_TextState.GetFontSize(); if (bPattern) { DrawTextPathWithPattern(textobj, pObj2Device, pFont, font_size, &text_matrix, bFill, bStroke); @@ -1763,7 +1762,7 @@ bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj, const CFX_Matrix* pDeviceMatrix = pObj2Device; CFX_Matrix device_matrix; if (bStroke) { - const FX_FLOAT* pCTM = textobj->m_TextState.GetCTM(); + const float* pCTM = textobj->m_TextState.GetCTM(); if (pCTM[0] != 1.0f || pCTM[3] != 1.0f) { CFX_Matrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0); text_matrix.ConcatInverse(ctm); @@ -1808,11 +1807,11 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj, return true; CFX_Matrix dCTM = m_pDevice->GetCTM(); - FX_FLOAT sa = FXSYS_fabs(dCTM.a); - FX_FLOAT sd = FXSYS_fabs(dCTM.d); + float sa = FXSYS_fabs(dCTM.a); + float sd = FXSYS_fabs(dCTM.d); CFX_Matrix text_matrix = textobj->GetTextMatrix(); CFX_Matrix char_matrix = pType3Font->GetFontMatrix(); - FX_FLOAT font_size = textobj->m_TextState.GetFontSize(); + float font_size = textobj->m_TextState.GetFontSize(); char_matrix.Scale(font_size, font_size); FX_ARGB fill_argb = GetFillArgb(textobj, true); int fill_alpha = FXARGB_A(fill_argb); @@ -1968,7 +1967,7 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj, void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj, const CFX_Matrix* pObj2Device, CPDF_Font* pFont, - FX_FLOAT font_size, + float font_size, const CFX_Matrix* pTextMatrix, bool bFill, bool bStroke) { @@ -2039,10 +2038,10 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, CPDF_Array* pBackColor = pDict->GetArrayFor("Background"); if (pBackColor && pBackColor->GetCount() >= pColorSpace->CountComponents()) { - CFX_FixedBufGrow<FX_FLOAT, 16> comps(pColorSpace->CountComponents()); + CFX_FixedBufGrow<float, 16> comps(pColorSpace->CountComponents()); for (uint32_t i = 0; i < pColorSpace->CountComponents(); i++) comps[i] = pBackColor->GetNumberAt(i); - FX_FLOAT R = 0.0f, G = 0.0f, B = 0.0f; + float R = 0.0f, G = 0.0f, B = 0.0f; pColorSpace->GetRGB(comps, R, G, B); background = ArgbEncode(255, (int32_t)(R * 255), (int32_t)(G * 255), (int32_t)(B * 255)); @@ -2189,8 +2188,8 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, return; } CFX_Matrix dCTM = m_pDevice->GetCTM(); - FX_FLOAT sa = FXSYS_fabs(dCTM.a); - FX_FLOAT sd = FXSYS_fabs(dCTM.d); + float sa = FXSYS_fabs(dCTM.a); + float sd = FXSYS_fabs(dCTM.d); clip_box.right = clip_box.left + (int32_t)FXSYS_ceil(clip_box.Width() * sa); clip_box.bottom = clip_box.top + (int32_t)FXSYS_ceil(clip_box.Height() * sd); CFX_Matrix mtPattern2Device = *pPattern->pattern_to_form(); @@ -2278,8 +2277,8 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, max_row--; } } - FX_FLOAT left_offset = cell_bbox.left - mtPattern2Device.e; - FX_FLOAT top_offset = cell_bbox.bottom - mtPattern2Device.f; + float left_offset = cell_bbox.left - mtPattern2Device.e; + float top_offset = cell_bbox.bottom - mtPattern2Device.f; std::unique_ptr<CFX_DIBitmap> pPatternBitmap; if (width * height < 16) { std::unique_ptr<CFX_DIBitmap> pEnlargedBitmap = @@ -2569,15 +2568,15 @@ std::unique_ptr<CFX_DIBitmap> CPDF_RenderStatus::LoadSMask( // Store Color Space Family to use in CPDF_RenderStatus::Initialize. color_space_family = pCS->GetFamily(); - FX_FLOAT R, G, B; + float R, G, B; uint32_t comps = 8; if (pCS->CountComponents() > comps) { comps = pCS->CountComponents(); } - CFX_FixedBufGrow<FX_FLOAT, 8> float_array(comps); - FX_FLOAT* pFloats = float_array; + CFX_FixedBufGrow<float, 8> float_array(comps); + float* pFloats = float_array; FX_SAFE_UINT32 num_floats = comps; - num_floats *= sizeof(FX_FLOAT); + num_floats *= sizeof(float); if (!num_floats.IsValid()) { return nullptr; } @@ -2618,9 +2617,9 @@ std::unique_ptr<CFX_DIBitmap> CPDF_RenderStatus::LoadSMask( int src_pitch = bitmap.GetPitch(); std::vector<uint8_t> transfers(256); if (pFunc) { - CFX_FixedBufGrow<FX_FLOAT, 16> results(pFunc->CountOutputs()); + CFX_FixedBufGrow<float, 16> results(pFunc->CountOutputs()); for (int i = 0; i < 256; i++) { - FX_FLOAT input = (FX_FLOAT)i / 255.0f; + float input = (float)i / 255.0f; int nresult; pFunc->Call(&input, 1, results, nresult); transfers[i] = FXSYS_round(results[0] * 255); diff --git a/core/fpdfapi/render/cpdf_renderstatus.h b/core/fpdfapi/render/cpdf_renderstatus.h index 25ddfb06c3..6ae255271b 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.h +++ b/core/fpdfapi/render/cpdf_renderstatus.h @@ -127,7 +127,7 @@ class CPDF_RenderStatus { void DrawTextPathWithPattern(const CPDF_TextObject* textobj, const CFX_Matrix* pObj2Device, CPDF_Font* pFont, - FX_FLOAT font_size, + float font_size, const CFX_Matrix* pTextMatrix, bool bFill, bool bStroke); diff --git a/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp b/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp index de60e732bb..927d23210c 100644 --- a/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp +++ b/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp @@ -40,9 +40,9 @@ bool CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, int dpiv = pDevice->GetDeviceCaps(FXDC_PIXEL_HEIGHT) * 254 / (vert_size * 10); if (dpih > max_dpi) - m_Matrix.Scale((FX_FLOAT)(max_dpi) / dpih, 1.0f); + m_Matrix.Scale((float)(max_dpi) / dpih, 1.0f); if (dpiv > max_dpi) - m_Matrix.Scale(1.0f, (FX_FLOAT)(max_dpi) / (FX_FLOAT)dpiv); + m_Matrix.Scale(1.0f, (float)(max_dpi) / (float)dpiv); } m_pBitmapDevice = pdfium::MakeUnique<CFX_FxgeDevice>(); FXDIB_Format dibFormat = FXDIB_Rgb; diff --git a/core/fpdfapi/render/cpdf_textrenderer.cpp b/core/fpdfapi/render/cpdf_textrenderer.cpp index 95af863f7a..c45c1ef792 100644 --- a/core/fpdfapi/render/cpdf_textrenderer.cpp +++ b/core/fpdfapi/render/cpdf_textrenderer.cpp @@ -18,9 +18,9 @@ // static bool CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice, const std::vector<uint32_t>& charCodes, - const std::vector<FX_FLOAT>& charPos, + const std::vector<float>& charPos, CPDF_Font* pFont, - FX_FLOAT font_size, + float font_size, const CFX_Matrix* pText2User, const CFX_Matrix* pUser2Device, const CFX_GraphStateData* pGraphState, @@ -65,10 +65,10 @@ bool CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice, // static void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice, - FX_FLOAT origin_x, - FX_FLOAT origin_y, + float origin_x, + float origin_y, CPDF_Font* pFont, - FX_FLOAT font_size, + float font_size, const CFX_Matrix* pMatrix, const CFX_ByteString& str, FX_ARGB fill_argb, @@ -83,10 +83,10 @@ void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice, int offset = 0; std::vector<uint32_t> codes; - std::vector<FX_FLOAT> positions; + std::vector<float> positions; codes.resize(nChars); positions.resize(nChars - 1); - FX_FLOAT cur_pos = 0; + float cur_pos = 0; for (int i = 0; i < nChars; i++) { codes[i] = pFont->GetNextChar(str.c_str(), str.GetLength(), offset); if (i) @@ -107,9 +107,9 @@ void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice, // static bool CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice, const std::vector<uint32_t>& charCodes, - const std::vector<FX_FLOAT>& charPos, + const std::vector<float>& charPos, CPDF_Font* pFont, - FX_FLOAT font_size, + float font_size, const CFX_Matrix* pText2Device, FX_ARGB fill_argb, const CPDF_RenderOptions* pOptions) { diff --git a/core/fpdfapi/render/cpdf_textrenderer.h b/core/fpdfapi/render/cpdf_textrenderer.h index 54e9d1bd05..31c44d9599 100644 --- a/core/fpdfapi/render/cpdf_textrenderer.h +++ b/core/fpdfapi/render/cpdf_textrenderer.h @@ -23,10 +23,10 @@ class CPDF_Font; class CPDF_TextRenderer { public: static void DrawTextString(CFX_RenderDevice* pDevice, - FX_FLOAT origin_x, - FX_FLOAT origin_y, + float origin_x, + float origin_y, CPDF_Font* pFont, - FX_FLOAT font_size, + float font_size, const CFX_Matrix* matrix, const CFX_ByteString& str, FX_ARGB fill_argb, @@ -35,9 +35,9 @@ class CPDF_TextRenderer { static bool DrawTextPath(CFX_RenderDevice* pDevice, const std::vector<uint32_t>& charCodes, - const std::vector<FX_FLOAT>& charPos, + const std::vector<float>& charPos, CPDF_Font* pFont, - FX_FLOAT font_size, + float font_size, const CFX_Matrix* pText2User, const CFX_Matrix* pUser2Device, const CFX_GraphStateData* pGraphState, @@ -48,9 +48,9 @@ class CPDF_TextRenderer { static bool DrawNormalText(CFX_RenderDevice* pDevice, const std::vector<uint32_t>& charCodes, - const std::vector<FX_FLOAT>& charPos, + const std::vector<float>& charPos, CPDF_Font* pFont, - FX_FLOAT font_size, + float font_size, const CFX_Matrix* pText2Device, FX_ARGB fill_argb, const CPDF_RenderOptions* pOptions); diff --git a/core/fpdfapi/render/cpdf_type3cache.cpp b/core/fpdfapi/render/cpdf_type3cache.cpp index a5de13b464..7d0cb18172 100644 --- a/core/fpdfapi/render/cpdf_type3cache.cpp +++ b/core/fpdfapi/render/cpdf_type3cache.cpp @@ -87,8 +87,8 @@ CPDF_Type3Cache::~CPDF_Type3Cache() { CFX_GlyphBitmap* CPDF_Type3Cache::LoadGlyph(uint32_t charcode, const CFX_Matrix* pMatrix, - FX_FLOAT retinaScaleX, - FX_FLOAT retinaScaleY) { + float retinaScaleX, + float retinaScaleY) { CPDF_UniqueKeyGen keygen; keygen.Generate( 4, FXSYS_round(pMatrix->a * 10000), FXSYS_round(pMatrix->b * 10000), @@ -115,8 +115,8 @@ CFX_GlyphBitmap* CPDF_Type3Cache::LoadGlyph(uint32_t charcode, CFX_GlyphBitmap* CPDF_Type3Cache::RenderGlyph(CPDF_Type3Glyphs* pSize, uint32_t charcode, const CFX_Matrix* pMatrix, - FX_FLOAT retinaScaleX, - FX_FLOAT retinaScaleY) { + float retinaScaleX, + float retinaScaleY) { const CPDF_Type3Char* pChar = m_pFont->LoadChar(charcode); if (!pChar || !pChar->m_pBitmap) return nullptr; @@ -134,11 +134,11 @@ CFX_GlyphBitmap* CPDF_Type3Cache::RenderGlyph(CPDF_Type3Glyphs* pSize, int top_line = DetectFirstLastScan(pBitmap, true); int bottom_line = DetectFirstLastScan(pBitmap, false); if (top_line == 0 && bottom_line == pBitmap->GetHeight() - 1) { - FX_FLOAT top_y = image_matrix.d + image_matrix.f; - FX_FLOAT bottom_y = image_matrix.f; + float top_y = image_matrix.d + image_matrix.f; + float bottom_y = image_matrix.f; bool bFlipped = top_y > bottom_y; if (bFlipped) { - FX_FLOAT temp = top_y; + float temp = top_y; top_y = bottom_y; bottom_y = temp; } diff --git a/core/fpdfapi/render/cpdf_type3cache.h b/core/fpdfapi/render/cpdf_type3cache.h index f74a43acc5..f03578650b 100644 --- a/core/fpdfapi/render/cpdf_type3cache.h +++ b/core/fpdfapi/render/cpdf_type3cache.h @@ -23,15 +23,15 @@ class CPDF_Type3Cache { CFX_GlyphBitmap* LoadGlyph(uint32_t charcode, const CFX_Matrix* pMatrix, - FX_FLOAT retinaScaleX, - FX_FLOAT retinaScaleY); + float retinaScaleX, + float retinaScaleY); private: CFX_GlyphBitmap* RenderGlyph(CPDF_Type3Glyphs* pSize, uint32_t charcode, const CFX_Matrix* pMatrix, - FX_FLOAT retinaScaleX, - FX_FLOAT retinaScaleY); + float retinaScaleX, + float retinaScaleY); CPDF_Type3Font* const m_pFont; std::map<CFX_ByteString, CPDF_Type3Glyphs*> m_SizeMap; diff --git a/core/fpdfapi/render/cpdf_type3glyphs.cpp b/core/fpdfapi/render/cpdf_type3glyphs.cpp index 189fc2439d..33d8ef1253 100644 --- a/core/fpdfapi/render/cpdf_type3glyphs.cpp +++ b/core/fpdfapi/render/cpdf_type3glyphs.cpp @@ -18,11 +18,11 @@ CPDF_Type3Glyphs::~CPDF_Type3Glyphs() { delete pair.second; } -static int _AdjustBlue(FX_FLOAT pos, int& count, int blues[]) { - FX_FLOAT min_distance = 1000000.0f; +static int _AdjustBlue(float pos, int& count, int blues[]) { + float min_distance = 1000000.0f; int closest_pos = -1; for (int i = 0; i < count; i++) { - FX_FLOAT distance = FXSYS_fabs(pos - static_cast<FX_FLOAT>(blues[i])); + float distance = FXSYS_fabs(pos - static_cast<float>(blues[i])); if (distance < 1.0f * 80.0f / 100.0f && distance < min_distance) { min_distance = distance; closest_pos = i; @@ -37,8 +37,8 @@ static int _AdjustBlue(FX_FLOAT pos, int& count, int blues[]) { return new_pos; } -void CPDF_Type3Glyphs::AdjustBlue(FX_FLOAT top, - FX_FLOAT bottom, +void CPDF_Type3Glyphs::AdjustBlue(float top, + float bottom, int& top_line, int& bottom_line) { top_line = _AdjustBlue(top, m_TopBlueCount, m_TopBlue); diff --git a/core/fpdfapi/render/cpdf_type3glyphs.h b/core/fpdfapi/render/cpdf_type3glyphs.h index 00814d5b3b..443910dac0 100644 --- a/core/fpdfapi/render/cpdf_type3glyphs.h +++ b/core/fpdfapi/render/cpdf_type3glyphs.h @@ -20,10 +20,7 @@ class CPDF_Type3Glyphs { CPDF_Type3Glyphs(); ~CPDF_Type3Glyphs(); - void AdjustBlue(FX_FLOAT top, - FX_FLOAT bottom, - int& top_line, - int& bottom_line); + void AdjustBlue(float top, float bottom, int& top_line, int& bottom_line); std::map<uint32_t, CFX_GlyphBitmap*> m_GlyphMap; int m_TopBlue[TYPE3_MAX_BLUES]; |