summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
authornpm <npm@chromium.org>2016-08-16 15:37:20 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-16 15:37:21 -0700
commitb88b8e47fd7adc14c7aff048c0def0579bdd22dd (patch)
tree50fe31941f6ff8cefa1d6b7eda3834f1f0c34a27 /core/fxge
parent09213860d9d9e9a88132cf69e60bb9af513fc1fa (diff)
downloadpdfium-b88b8e47fd7adc14c7aff048c0def0579bdd22dd.tar.xz
Delete m_ExtHandle and RetainFont because they are not being used.
CFX_SubstFont::m_ExtHandle is never assigned a value different from nullptr. Similarly, IFX_SystemFontInfo::RetainFont has two implementations. Both of these return nullptr, so this method is not needed. Review-Url: https://codereview.chromium.org/2252833002
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/android/fx_android_font.cpp4
-rw-r--r--core/fxge/android/fx_android_font.h1
-rw-r--r--core/fxge/ge/cfx_fontmapper.cpp1
-rw-r--r--core/fxge/ge/fx_ge_font.cpp7
-rw-r--r--core/fxge/ge/fx_ge_fontmap.cpp5
-rw-r--r--core/fxge/ge/fx_ge_text.cpp12
-rw-r--r--core/fxge/include/fx_font.h1
-rw-r--r--core/fxge/include/ifx_systemfontinfo.h1
8 files changed, 4 insertions, 28 deletions
diff --git a/core/fxge/android/fx_android_font.cpp b/core/fxge/android/fx_android_font.cpp
index b1bfe90c1e..58a5ab4b85 100644
--- a/core/fxge/android/fx_android_font.cpp
+++ b/core/fxge/android/fx_android_font.cpp
@@ -88,8 +88,4 @@ void CFX_AndroidFontInfo::DeleteFont(void* hFont) {
static_cast<CFPF_SkiaFont*>(hFont)->Release();
}
-void* CFX_AndroidFontInfo::RetainFont(void* hFont) {
- return nullptr;
-}
-
#endif // _FX_OS_ == _FX_ANDROID_
diff --git a/core/fxge/android/fx_android_font.h b/core/fxge/android/fx_android_font.h
index 881bd1db5f..ad777f3e58 100644
--- a/core/fxge/android/fx_android_font.h
+++ b/core/fxge/android/fx_android_font.h
@@ -40,7 +40,6 @@ class CFX_AndroidFontInfo : public IFX_SystemFontInfo {
FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) override;
FX_BOOL GetFontCharset(void* hFont, int& charset) override;
void DeleteFont(void* hFont) override;
- void* RetainFont(void* hFont) override;
protected:
CFPF_SkiaFontMgr* m_pFontMgr;
diff --git a/core/fxge/ge/cfx_fontmapper.cpp b/core/fxge/ge/cfx_fontmapper.cpp
index 27853a0443..9486932f61 100644
--- a/core/fxge/ge/cfx_fontmapper.cpp
+++ b/core/fxge/ge/cfx_fontmapper.cpp
@@ -689,7 +689,6 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
hFont = m_pFontInfo->GetFont(it->name.c_str());
}
}
- pSubstFont->m_ExtHandle = m_pFontInfo->RetainFont(hFont);
if (!hFont)
return nullptr;
diff --git a/core/fxge/ge/fx_ge_font.cpp b/core/fxge/ge/fx_ge_font.cpp
index 4d3328551f..4e0627fba6 100644
--- a/core/fxge/ge/fx_ge_font.cpp
+++ b/core/fxge/ge/fx_ge_font.cpp
@@ -103,7 +103,6 @@ FX_BOOL CFX_Font::LoadClone(const CFX_Font* pFont) {
if (pFont->m_pSubstFont) {
m_pSubstFont.reset(new CFX_SubstFont);
m_pSubstFont->m_Charset = pFont->m_pSubstFont->m_Charset;
- m_pSubstFont->m_ExtHandle = pFont->m_pSubstFont->m_ExtHandle;
m_pSubstFont->m_SubstFlags = pFont->m_pSubstFont->m_SubstFlags;
m_pSubstFont->m_Weight = pFont->m_pSubstFont->m_Weight;
m_pSubstFont->m_Family = pFont->m_pSubstFont->m_Family;
@@ -173,12 +172,6 @@ void CFX_Font::LoadSubst(const CFX_ByteString& face_name,
m_Face = CFX_GEModule::Get()->GetFontMgr()->FindSubstFont(
face_name, bTrueType, flags, weight, italic_angle, CharsetCP,
m_pSubstFont.get());
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (m_pSubstFont->m_ExtHandle) {
- m_pPlatformFont = m_pSubstFont->m_ExtHandle;
- m_pSubstFont->m_ExtHandle = nullptr;
- }
-#endif
if (m_Face) {
m_pFontData = FXFT_Get_Face_Stream_Base(m_Face);
m_dwSize = FXFT_Get_Face_Stream_Size(m_Face);
diff --git a/core/fxge/ge/fx_ge_fontmap.cpp b/core/fxge/ge/fx_ge_fontmap.cpp
index 408f1e2689..6de364788b 100644
--- a/core/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/fxge/ge/fx_ge_fontmap.cpp
@@ -8,7 +8,6 @@
#include "core/fxge/include/ifx_systemfontinfo.h"
CFX_SubstFont::CFX_SubstFont() {
- m_ExtHandle = nullptr;
m_Charset = FXFONT_ANSI_CHARSET;
m_SubstFlags = 0;
m_Weight = 0;
@@ -109,10 +108,6 @@ int IFX_SystemFontInfo::GetFaceIndex(void* hFont) {
return 0;
}
-void* IFX_SystemFontInfo::RetainFont(void* hFont) {
- return nullptr;
-}
-
extern "C" {
unsigned long _FTStreamRead(FXFT_Stream stream,
unsigned long offset,
diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp
index 5fea141a42..9ed751b708 100644
--- a/core/fxge/ge/fx_ge_text.cpp
+++ b/core/fxge/ge/fx_ge_text.cpp
@@ -113,10 +113,8 @@ CFX_FontCache::~CFX_FontCache() {
}
CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont) {
- FXFT_Face internal_face = pFont->GetFace();
- const bool bExternal = !internal_face;
- FXFT_Face face =
- bExternal ? (FXFT_Face)pFont->GetSubstFont()->m_ExtHandle : internal_face;
+ FXFT_Face face = pFont->GetFace();
+ const bool bExternal = !face;
CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
auto it = map.find(face);
if (it != map.end()) {
@@ -150,10 +148,8 @@ CFX_TypeFace* CFX_FaceCache::GetDeviceCache(CFX_Font* pFont) {
#endif
void CFX_FontCache::ReleaseCachedFace(CFX_Font* pFont) {
- FXFT_Face internal_face = pFont->GetFace();
- const bool bExternal = !internal_face;
- FXFT_Face face =
- bExternal ? (FXFT_Face)pFont->GetSubstFont()->m_ExtHandle : internal_face;
+ FXFT_Face face = pFont->GetFace();
+ const bool bExternal = !face;
CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
auto it = map.find(face);
diff --git a/core/fxge/include/fx_font.h b/core/fxge/include/fx_font.h
index 524a540c38..8c7928199b 100644
--- a/core/fxge/include/fx_font.h
+++ b/core/fxge/include/fx_font.h
@@ -221,7 +221,6 @@ class CFX_SubstFont {
public:
CFX_SubstFont();
- void* m_ExtHandle;
CFX_ByteString m_Family;
int m_Charset;
uint32_t m_SubstFlags;
diff --git a/core/fxge/include/ifx_systemfontinfo.h b/core/fxge/include/ifx_systemfontinfo.h
index 9ede09ec26..b5bab6fe31 100644
--- a/core/fxge/include/ifx_systemfontinfo.h
+++ b/core/fxge/include/ifx_systemfontinfo.h
@@ -44,7 +44,6 @@ class IFX_SystemFontInfo {
virtual FX_BOOL GetFontCharset(void* hFont, int& charset) = 0;
virtual int GetFaceIndex(void* hFont);
virtual void DeleteFont(void* hFont) = 0;
- virtual void* RetainFont(void* hFont);
};
#endif // CORE_FXGE_INCLUDE_IFX_SYSTEMFONTINFO_H_