From d734fd2f60c68a4cfa0e5bb8ff85d357605d3449 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 30 Mar 2016 13:36:45 -0700 Subject: Rename _CPDF_UniqueKeyGen to CPDF_UniqueKeyGen Review URL: https://codereview.chromium.org/1841313004 --- core/fpdfapi/fpdf_render/fpdf_render_text.cpp | 34 ++++++++++++++++++--------- core/fpdfapi/fpdf_render/render_int.h | 6 ----- 2 files changed, 23 insertions(+), 17 deletions(-) (limited to 'core') diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp index c38362fb70..0165e8a7d7 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp @@ -23,6 +23,27 @@ #include "core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h" #include "core/include/fxge/fx_ge.h" +namespace { + +struct CPDF_UniqueKeyGen { + void Generate(int count, ...); + FX_CHAR m_Key[128]; + int m_KeyLen; +}; + +void CPDF_UniqueKeyGen::Generate(int count, ...) { + va_list argList; + va_start(argList, count); + for (int i = 0; i < count; i++) { + int p = va_arg(argList, int); + ((uint32_t*)m_Key)[i] = p; + } + va_end(argList); + m_KeyLen = count * sizeof(uint32_t); +} + +} // namespace + CPDF_Type3Cache::~CPDF_Type3Cache() { for (const auto& pair : m_SizeMap) { delete pair.second; @@ -33,7 +54,7 @@ CFX_GlyphBitmap* CPDF_Type3Cache::LoadGlyph(uint32_t charcode, const CFX_Matrix* pMatrix, FX_FLOAT retinaScaleX, FX_FLOAT retinaScaleY) { - _CPDF_UniqueKeyGen keygen; + CPDF_UniqueKeyGen keygen; keygen.Generate( 4, FXSYS_round(pMatrix->a * 10000), FXSYS_round(pMatrix->b * 10000), FXSYS_round(pMatrix->c * 10000), FXSYS_round(pMatrix->d * 10000)); @@ -187,16 +208,7 @@ CFX_GlyphBitmap* CPDF_Type3Cache::RenderGlyph(CPDF_Type3Glyphs* pSize, delete pResBitmap; return pGlyph; } -void _CPDF_UniqueKeyGen::Generate(int count, ...) { - va_list argList; - va_start(argList, count); - for (int i = 0; i < count; i++) { - int p = va_arg(argList, int); - ((uint32_t*)m_Key)[i] = p; - } - va_end(argList); - m_KeyLen = count * sizeof(uint32_t); -} + FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, const CFX_Matrix* pObj2Device, CFX_PathData* pClippingPath) { diff --git a/core/fpdfapi/fpdf_render/render_int.h b/core/fpdfapi/fpdf_render/render_int.h index a3b8d76fe7..b22b9fc39b 100644 --- a/core/fpdfapi/fpdf_render/render_int.h +++ b/core/fpdfapi/fpdf_render/render_int.h @@ -636,10 +636,4 @@ class CPDF_DIBTransferFunc : public CFX_FilteredDIB { const uint8_t* m_RampB; }; -struct _CPDF_UniqueKeyGen { - void Generate(int count, ...); - FX_CHAR m_Key[128]; - int m_KeyLen; -}; - #endif // CORE_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ -- cgit v1.2.3