summaryrefslogtreecommitdiff
path: root/core/fxge/android/cfpf_skiafont.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-17 23:51:08 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-17 23:51:08 +0000
commit2f113cac5ff28008c702898f41e691c8d233db5f (patch)
treeac5f32f69105a716e05efe8565f9dc1e24313868 /core/fxge/android/cfpf_skiafont.h
parent3f9a65a6bc254008625d6641ff9c54a40a64fb70 (diff)
downloadpdfium-2f113cac5ff28008c702898f41e691c8d233db5f.tar.xz
Get rid of CFPF_SkiaFont::InitFont().
Initialize via the ctor instead. Also fix refcounting for the class, so the refcount does not go negative for invalid fonts. Change-Id: I5cf51ae9051f5fc5e0204193d18f8eb37b34c244 Reviewed-on: https://pdfium-review.googlesource.com/40590 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxge/android/cfpf_skiafont.h')
-rw-r--r--core/fxge/android/cfpf_skiafont.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/core/fxge/android/cfpf_skiafont.h b/core/fxge/android/cfpf_skiafont.h
index d80378ec75..4e3b02d892 100644
--- a/core/fxge/android/cfpf_skiafont.h
+++ b/core/fxge/android/cfpf_skiafont.h
@@ -16,12 +16,16 @@ class CFPF_SkiaPathFont;
class CFPF_SkiaFont {
public:
- CFPF_SkiaFont();
- ~CFPF_SkiaFont();
+ CFPF_SkiaFont(CFPF_SkiaFontMgr* pFontMgr,
+ const CFPF_SkiaPathFont* pFont,
+ uint32_t dwStyle,
+ uint8_t uCharset);
void Release();
CFPF_SkiaFont* Retain();
+ bool IsValid() const { return !!m_Face; }
+
ByteString GetFamilyName();
ByteString GetPsName();
uint32_t GetFontStyle() const { return m_dwStyle; }
@@ -36,18 +40,14 @@ class CFPF_SkiaFont {
int32_t GetItalicAngle() const;
uint32_t GetFontData(uint32_t dwTable, uint8_t* pBuffer, uint32_t dwSize);
- bool InitFont(CFPF_SkiaFontMgr* pFontMgr,
- const CFPF_SkiaPathFont* pFont,
- const ByteStringView& bsFamily,
- uint32_t dwStyle,
- uint8_t uCharset);
-
private:
- UnownedPtr<CFPF_SkiaFontMgr> m_pFontMgr;
- UnownedPtr<const CFPF_SkiaPathFont> m_pFont;
- FXFT_Face m_Face = nullptr;
- uint32_t m_dwStyle = 0;
- uint8_t m_uCharset = 0;
+ ~CFPF_SkiaFont();
+
+ UnownedPtr<CFPF_SkiaFontMgr> const m_pFontMgr;
+ UnownedPtr<const CFPF_SkiaPathFont> const m_pFont;
+ const FXFT_Face m_Face;
+ const uint32_t m_dwStyle;
+ const uint8_t m_uCharset;
uint32_t m_dwRefCount = 0;
};