Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1688)

Unified Diff: core/src/fxge/ge/fx_ge_text.cpp

Issue 1426403008: Cleanup some fxge font code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxge/ge/fx_ge_fontmap.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/ge/fx_ge_text.cpp
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index 6cc9790e569647bc74f9ed3e7de28961f8830875..efb4366423562aa9c595b400cadb7318506411c8 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -37,7 +37,8 @@ class ScopedFontTransform {
private:
FT_Face m_Face;
};
-}
+
+} // namespace
FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos,
int nChars,
@@ -295,10 +296,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);
@@ -1228,9 +1230,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;
@@ -1656,12 +1657,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)) {
« no previous file with comments | « core/src/fxge/ge/fx_ge_fontmap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698