summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_facecache.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-11-30 18:56:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-30 18:56:00 +0000
commit247c0e05dacb3b958bb7aaf06f21b93e78c43e19 (patch)
treedbe1c1a7e36523124180b1f99ce7c58fe621d98d /core/fxge/cfx_facecache.h
parentfee910e6f81fd199bfe4fd62ea538d1bc33056a8 (diff)
downloadpdfium-247c0e05dacb3b958bb7aaf06f21b93e78c43e19.tar.xz
Relax checks in CFX_FaceCache::LoadGlyphPath().
The original fix to https://crbug.com/641333 was too strict. Relax the checks and use a std::tuple for the path map key, instead of trying to "hash" a key. BUG=chromium:788864 Change-Id: I6e6a96691bce2834c2e95baa16ebd39e6aa03140 Reviewed-on: https://pdfium-review.googlesource.com/19950 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/cfx_facecache.h')
-rw-r--r--core/fxge/cfx_facecache.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/fxge/cfx_facecache.h b/core/fxge/cfx_facecache.h
index aa98161719..a39da88b01 100644
--- a/core/fxge/cfx_facecache.h
+++ b/core/fxge/cfx_facecache.h
@@ -9,6 +9,7 @@
#include <map>
#include <memory>
+#include <tuple>
#include "core/fxcrt/unowned_ptr.h"
#include "core/fxge/fx_font.h"
@@ -42,6 +43,8 @@ class CFX_FaceCache {
private:
using SizeGlyphCache = std::map<uint32_t, std::unique_ptr<CFX_GlyphBitmap>>;
+ // <glyph_index, width, weight, angle, vertical>
+ using PathMapKey = std::tuple<uint32_t, int, int, int, bool>;
std::unique_ptr<CFX_GlyphBitmap> RenderGlyph(const CFX_Font* pFont,
uint32_t glyph_index,
@@ -67,7 +70,7 @@ class CFX_FaceCache {
FXFT_Face const m_Face;
std::map<ByteString, SizeGlyphCache> m_SizeMap;
- std::map<uint32_t, std::unique_ptr<CFX_PathData>> m_PathMap;
+ std::map<PathMapKey, std::unique_ptr<CFX_PathData>> m_PathMap;
#if defined _SKIA_SUPPORT_ || _SKIA_SUPPORT_PATHS_
sk_sp<SkTypeface> m_pTypeface;
#endif