summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_facecache.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-26 10:52:53 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-26 15:24:34 +0000
commit15dffdf6bd8d595193cfb072974a8efeb8052a91 (patch)
tree6f29c7c7eb78f6d1453a86ed643f2d1e41533f2b /core/fxge/cfx_facecache.cpp
parent1a43b3064dc38a55de4b1d727237806578bb3ef9 (diff)
downloadpdfium-15dffdf6bd8d595193cfb072974a8efeb8052a91.tar.xz
Remove fx_text_int.h
The CFX_SizeGlyphCache is only used internally by the CFX_FaceCache. This CL moves the definition to that file and removes fx_text_int.h Change-Id: I38f26f437f0eaa72492995ae7442d5c38ed2f229 Reviewed-on: https://pdfium-review.googlesource.com/14771 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/cfx_facecache.cpp')
-rw-r--r--core/fxge/cfx_facecache.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/core/fxge/cfx_facecache.cpp b/core/fxge/cfx_facecache.cpp
index 7075c1f9f5..217c41119c 100644
--- a/core/fxge/cfx_facecache.cpp
+++ b/core/fxge/cfx_facecache.cpp
@@ -17,7 +17,6 @@
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/cfx_substfont.h"
#include "core/fxge/fx_freetype.h"
-#include "core/fxge/fx_text_int.h"
#include "third_party/base/numerics/safe_math.h"
#include "third_party/base/ptr_util.h"
@@ -330,27 +329,28 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(const CFX_Font* pFont,
std::unique_ptr<CFX_GlyphBitmap> pGlyphBitmap;
auto it = m_SizeMap.find(FaceGlyphsKey);
if (it != m_SizeMap.end()) {
- CFX_SizeGlyphCache* pSizeCache = it->second.get();
- auto it2 = pSizeCache->m_GlyphMap.find(glyph_index);
- if (it2 != pSizeCache->m_GlyphMap.end())
+ SizeGlyphCache* pSizeCache = &(it->second);
+ auto it2 = pSizeCache->find(glyph_index);
+ if (it2 != pSizeCache->end())
return it2->second.get();
pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix,
dest_width, anti_alias);
if (pGlyphBitmap) {
CFX_GlyphBitmap* pResult = pGlyphBitmap.get();
- pSizeCache->m_GlyphMap[glyph_index] = std::move(pGlyphBitmap);
+ (*pSizeCache)[glyph_index] = std::move(pGlyphBitmap);
return pResult;
}
} else {
pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix,
dest_width, anti_alias);
if (pGlyphBitmap) {
- auto pNewCache = pdfium::MakeUnique<CFX_SizeGlyphCache>();
- CFX_SizeGlyphCache* pSizeCache = pNewCache.get();
- m_SizeMap[FaceGlyphsKey] = std::move(pNewCache);
CFX_GlyphBitmap* pResult = pGlyphBitmap.get();
- pSizeCache->m_GlyphMap[glyph_index] = std::move(pGlyphBitmap);
+
+ SizeGlyphCache cache;
+ cache[glyph_index] = std::move(pGlyphBitmap);
+
+ m_SizeMap[FaceGlyphsKey] = std::move(cache);
return pResult;
}
}
@@ -398,22 +398,22 @@ CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap(
bool bFontStyle,
int dest_width,
int anti_alias) {
- CFX_SizeGlyphCache* pSizeCache;
+ SizeGlyphCache* pSizeCache;
auto it = m_SizeMap.find(FaceGlyphsKey);
if (it == m_SizeMap.end()) {
- auto pNewCache = pdfium::MakeUnique<CFX_SizeGlyphCache>();
- pSizeCache = pNewCache.get();
- m_SizeMap[FaceGlyphsKey] = std::move(pNewCache);
+ m_SizeMap[FaceGlyphsKey] = SizeGlyphCache();
+ pSizeCache = &(m_SizeMap[FaceGlyphsKey]);
} else {
- pSizeCache = it->second.get();
+ pSizeCache = &(it->second);
}
- auto it2 = pSizeCache->m_GlyphMap.find(glyph_index);
- if (it2 != pSizeCache->m_GlyphMap.end())
+
+ auto it2 = pSizeCache->find(glyph_index);
+ if (it2 != pSizeCache->end())
return it2->second.get();
std::unique_ptr<CFX_GlyphBitmap> pGlyphBitmap = RenderGlyph(
pFont, glyph_index, bFontStyle, pMatrix, dest_width, anti_alias);
CFX_GlyphBitmap* pResult = pGlyphBitmap.get();
- pSizeCache->m_GlyphMap[glyph_index] = std::move(pGlyphBitmap);
+ (*pSizeCache)[glyph_index] = std::move(pGlyphBitmap);
return pResult;
}