summaryrefslogtreecommitdiff
path: root/core/src/fxge/ge/fx_ge_text.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-11-09 10:48:13 -0800
committerLei Zhang <thestig@chromium.org>2015-11-09 10:48:13 -0800
commit3beeeeeb2ca45d54b34e4cc80fb137980e2f7aae (patch)
treecbf3e546569962e733c515f81e022506c7334a5f /core/src/fxge/ge/fx_ge_text.cpp
parent8698aff8381399e82bafa892ed9f0e605065e45c (diff)
downloadpdfium-3beeeeeb2ca45d54b34e4cc80fb137980e2f7aae.tar.xz
Merge to XFA: Cleanup some fxge font code.
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1426403008 . (cherry picked from commit 94a4956f7aadc10fe6dd8451e965bd7447985b76) Review URL: https://codereview.chromium.org/1410683013 .
Diffstat (limited to 'core/src/fxge/ge/fx_ge_text.cpp')
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index 2f7641ac64..2b8128dde0 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -12,6 +12,7 @@
#undef FX_GAMMA_INVERSE
#define FX_GAMMA(value) (value)
#define FX_GAMMA_INVERSE(value) (value)
+
FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos,
int nChars,
int anti_alias,
@@ -268,10 +269,11 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars,
glyph.m_pGlyph = pFaceCache->LoadGlyphBitmap(
pFont, charpos.m_GlyphIndex, charpos.m_bFontStyle, &new_matrix,
charpos.m_FontCharWidth, anti_alias, nativetext_flags);
- } else
+ } else {
glyph.m_pGlyph = pFaceCache->LoadGlyphBitmap(
pFont, charpos.m_GlyphIndex, charpos.m_bFontStyle, &deviceCtm,
charpos.m_FontCharWidth, anti_alias, nativetext_flags);
+ }
}
if (anti_alias < FXFT_RENDER_MODE_LCD && nChars > 1) {
_AdjustGlyphSpace(pGlyphAndPos, nChars);
@@ -1200,9 +1202,8 @@ void CFX_FontCache::FreeCache(FX_BOOL bRelease) {
}
}
-CFX_FaceCache::CFX_FaceCache(FXFT_Face face) {
- m_Face = face;
-}
+CFX_FaceCache::CFX_FaceCache(FXFT_Face face) : m_Face(face) {}
+
CFX_FaceCache::~CFX_FaceCache() {
for (const auto& pair : m_SizeMap) {
delete pair.second;
@@ -1628,12 +1629,12 @@ const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont,
}
CFX_PathData* pGlyphPath = NULL;
void* key;
- if (pFont->GetSubstFont())
+ if (pFont->GetSubstFont()) {
key = (void*)(uintptr_t)(
glyph_index + ((pFont->GetSubstFont()->m_Weight / 16) << 15) +
((pFont->GetSubstFont()->m_ItalicAngle / 2) << 21) +
((dest_width / 16) << 25) + (pFont->IsVertical() << 31));
- else {
+ } else {
key = (void*)(uintptr_t)glyph_index;
}
if (m_PathMap.Lookup(key, (void*&)pGlyphPath)) {