summaryrefslogtreecommitdiff
path: root/core/fxge/android/cfpf_skiafont.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-17 20:40:52 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-17 20:40:52 +0000
commit16208a0ef769a84c7e96ff5d55a16637ca01de03 (patch)
tree3d1c284c605f5fe6ade43fbe499ed3f245bcb886 /core/fxge/android/cfpf_skiafont.cpp
parent1b2b76d634ba3716ee43a553cd952927a7d262a2 (diff)
downloadpdfium-16208a0ef769a84c7e96ff5d55a16637ca01de03.tar.xz
Remove CFPF_SkiaFontDescriptor.
CFPF_SkiaFontDescriptor only has a single subclass. Merge it with the subclass. Change-Id: I26d19ee527c010d2d69acd820d8acc9634b12239 Reviewed-on: https://pdfium-review.googlesource.com/40551 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/android/cfpf_skiafont.cpp')
-rw-r--r--core/fxge/android/cfpf_skiafont.cpp25
1 files changed, 5 insertions, 20 deletions
diff --git a/core/fxge/android/cfpf_skiafont.cpp b/core/fxge/android/cfpf_skiafont.cpp
index 6431f14c57..24984e8d9f 100644
--- a/core/fxge/android/cfpf_skiafont.cpp
+++ b/core/fxge/android/cfpf_skiafont.cpp
@@ -9,20 +9,13 @@
#include <algorithm>
#include "core/fxcrt/fx_system.h"
-#include "core/fxge/android/cfpf_skiafontdescriptor.h"
#include "core/fxge/android/cfpf_skiafontmgr.h"
#include "core/fxge/android/cfpf_skiapathfont.h"
#include "core/fxge/fx_freetype.h"
#define FPF_EM_ADJUST(em, a) (em == 0 ? (a) : (a)*1000 / em)
-CFPF_SkiaFont::CFPF_SkiaFont()
- : m_pFontMgr(nullptr),
- m_pFontDes(nullptr),
- m_Face(nullptr),
- m_dwStyle(0),
- m_uCharset(0),
- m_dwRefCount(0) {}
+CFPF_SkiaFont::CFPF_SkiaFont() = default;
CFPF_SkiaFont::~CFPF_SkiaFont() {
if (m_Face)
@@ -178,29 +171,21 @@ uint32_t CFPF_SkiaFont::GetFontData(uint32_t dwTable,
}
bool CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr* pFontMgr,
- CFPF_SkiaFontDescriptor* pFontDes,
+ CFPF_SkiaPathFont* pFont,
const ByteStringView& bsFamily,
uint32_t dwStyle,
uint8_t uCharset) {
- if (!pFontMgr || !pFontDes)
+ if (!pFontMgr || !pFont)
return false;
- switch (pFontDes->GetType()) {
- case FPF_SKIAFONTTYPE_Path: {
- CFPF_SkiaPathFont* pFont = (CFPF_SkiaPathFont*)pFontDes;
- m_Face = pFontMgr->GetFontFace(pFont->m_pPath, pFont->m_iFaceIndex);
- break;
- }
- default:
- return false;
- }
+ m_Face = pFontMgr->GetFontFace(pFont->m_pPath, pFont->m_iFaceIndex);
if (!m_Face)
return false;
m_dwStyle = dwStyle;
m_uCharset = uCharset;
m_pFontMgr = pFontMgr;
- m_pFontDes = pFontDes;
+ m_pFont = pFont;
m_dwRefCount = 1;
return true;
}