summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-25 15:16:40 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-25 19:29:21 +0000
commit95ec3976ab6cdb22cc6d63c6eeaec9536ae61284 (patch)
treedfc3bc56d3d8999a1895bd63f5037d03719e0927 /core
parent92627618a93720c6153828b8a8d1c6ed17c6e91f (diff)
downloadpdfium-95ec3976ab6cdb22cc6d63c6eeaec9536ae61284.tar.xz
Hide CFX_UniqueKeyGen
The CFX_UniqueKeyGen struct is only used in cfx_facecache.cpp. This CL moves the struct to the anonymous namespace of that file. Change-Id: I1ec85126070e2e0446abc5639cea8465cb490f1a Reviewed-on: https://pdfium-review.googlesource.com/14770 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fxge/cfx_facecache.cpp24
-rw-r--r--core/fxge/fx_ge_text.cpp11
-rw-r--r--core/fxge/fx_text_int.h7
3 files changed, 21 insertions, 21 deletions
diff --git a/core/fxge/cfx_facecache.cpp b/core/fxge/cfx_facecache.cpp
index 74b38ef61d..7075c1f9f5 100644
--- a/core/fxge/cfx_facecache.cpp
+++ b/core/fxge/cfx_facecache.cpp
@@ -77,6 +77,24 @@ void ContrastAdjust(uint8_t* pDataIn,
}
}
+struct UniqueKeyGen {
+ void Generate(int count, ...);
+
+ char key_[128];
+ int key_len_;
+};
+
+void UniqueKeyGen::Generate(int count, ...) {
+ va_list argList;
+ va_start(argList, count);
+ for (int i = 0; i < count; i++) {
+ int p = va_arg(argList, int);
+ reinterpret_cast<uint32_t*>(key_)[i] = p;
+ }
+ va_end(argList);
+ key_len_ = count * sizeof(uint32_t);
+}
+
} // namespace
CFX_FaceCache::CFX_FaceCache(FXFT_Face face)
@@ -262,7 +280,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(const CFX_Font* pFont,
if (glyph_index == kInvalidGlyphIndex)
return nullptr;
- CFX_UniqueKeyGen keygen;
+ UniqueKeyGen keygen;
int nMatrixA = static_cast<int>(pMatrix->a * 10000);
int nMatrixB = static_cast<int>(pMatrix->b * 10000);
int nMatrixC = static_cast<int>(pMatrix->c * 10000);
@@ -299,7 +317,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(const CFX_Font* pFont,
}
}
#endif
- ByteString FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen);
+ ByteString FaceGlyphsKey(keygen.key_, keygen.key_len_);
#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_ || \
defined _SKIA_SUPPORT_PATHS_
return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index,
@@ -344,7 +362,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(const CFX_Font* pFont,
keygen.Generate(6, nMatrixA, nMatrixB, nMatrixC, nMatrixD, dest_width,
anti_alias);
}
- ByteString FaceGlyphsKey2(keygen.m_Key, keygen.m_KeyLen);
+ ByteString FaceGlyphsKey2(keygen.key_, keygen.key_len_);
text_flags |= FXTEXT_NO_NATIVETEXT;
return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey2, glyph_index,
bFontStyle, dest_width, anti_alias);
diff --git a/core/fxge/fx_ge_text.cpp b/core/fxge/fx_ge_text.cpp
index 39c82b2751..a04e43f75d 100644
--- a/core/fxge/fx_ge_text.cpp
+++ b/core/fxge/fx_ge_text.cpp
@@ -107,14 +107,3 @@ FX_RECT FXGE_GetGlyphsBBox(const std::vector<FXTEXT_GLYPHPOS>& glyphs,
CFX_SizeGlyphCache::CFX_SizeGlyphCache() {}
CFX_SizeGlyphCache::~CFX_SizeGlyphCache() {}
-
-void CFX_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);
-}
diff --git a/core/fxge/fx_text_int.h b/core/fxge/fx_text_int.h
index 6af8eb9165..da594443cc 100644
--- a/core/fxge/fx_text_int.h
+++ b/core/fxge/fx_text_int.h
@@ -13,13 +13,6 @@
#include "core/fxge/fx_font.h"
#include "core/fxge/fx_freetype.h"
-struct CFX_UniqueKeyGen {
- void Generate(int count, ...);
-
- char m_Key[128];
- int m_KeyLen;
-};
-
class CFX_SizeGlyphCache {
public:
CFX_SizeGlyphCache();