diff options
author | Lei Zhang <thestig@chromium.org> | 2015-08-14 21:49:19 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-08-14 21:49:19 -0700 |
commit | 62b2e912dc2a508972fbf01b25f7449c39ff1543 (patch) | |
tree | 47a244dc5891b2a338ca529b796e12994e642cbc /core/src/fxge/android | |
parent | bdf72c353af5b8a34ef5efdeddfff36d2089a158 (diff) | |
download | pdfium-62b2e912dc2a508972fbf01b25f7449c39ff1543.tar.xz |
Merge to XFA: Use override in more classes in core/
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1292613003 .
(cherry picked from commit c2c3f7b5f0396409451a9d344f35ec1929a76e9f)
Review URL: https://codereview.chromium.org/1296043002 .
Diffstat (limited to 'core/src/fxge/android')
-rw-r--r-- | core/src/fxge/android/fpf_skiafont.h | 49 | ||||
-rw-r--r-- | core/src/fxge/android/fpf_skiafontmgr.h | 49 | ||||
-rw-r--r-- | core/src/fxge/android/fpf_skiamodule.h | 14 |
3 files changed, 69 insertions, 43 deletions
diff --git a/core/src/fxge/android/fpf_skiafont.h b/core/src/fxge/android/fpf_skiafont.h index 4a841940df..6ee2f258e4 100644 --- a/core/src/fxge/android/fpf_skiafont.h +++ b/core/src/fxge/android/fpf_skiafont.h @@ -8,38 +8,37 @@ #define CORE_SRC_FXGE_ANDROID_FPF_SKIAFONT_H_ #if _FX_OS_ == _FX_ANDROID_ + +#include "../../../include/fxge/fpf.h" + class CFPF_SkiaFontDescriptor; class CFPF_SkiaFontMgr; class SkTypeface; class CFPF_SkiaFont : public IFPF_Font { public: CFPF_SkiaFont(); - virtual ~CFPF_SkiaFont(); - virtual void Release(); - virtual IFPF_Font* Retain(); - - virtual FPF_HFONT GetHandle(); - - virtual CFX_ByteString GetFamilyName(); - virtual CFX_WideString GetPsName(); - - virtual FX_DWORD GetFontStyle() const { return m_dwStyle; } - virtual uint8_t GetCharset() const { return m_uCharset; } - - virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode); - virtual int32_t GetGlyphWidth(int32_t iGlyphIndex); - - virtual int32_t GetAscent() const; - virtual int32_t GetDescent() const; - - virtual FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT& rtBBox); - virtual FX_BOOL GetBBox(FX_RECT& rtBBox); + ~CFPF_SkiaFont() override; + + // IFPF_Font + void Release() override; + IFPF_Font* Retain() override; + FPF_HFONT GetHandle() override; + CFX_ByteString GetFamilyName() override; + CFX_WideString GetPsName() override; + FX_DWORD GetFontStyle() const override { return m_dwStyle; } + uint8_t GetCharset() const override { return m_uCharset; } + int32_t GetGlyphIndex(FX_WCHAR wUnicode) override; + int32_t GetGlyphWidth(int32_t iGlyphIndex) override; + int32_t GetAscent() const override; + int32_t GetDescent() const override; + FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT& rtBBox) override; + FX_BOOL GetBBox(FX_RECT& rtBBox) override; + int32_t GetHeight() const override; + int32_t GetItalicAngle() const override; + FX_DWORD GetFontData(FX_DWORD dwTable, + uint8_t* pBuffer, + FX_DWORD dwSize) override; - virtual int32_t GetHeight() const; - virtual int32_t GetItalicAngle() const; - virtual FX_DWORD GetFontData(FX_DWORD dwTable, - uint8_t* pBuffer, - FX_DWORD dwSize); FX_BOOL InitFont(CFPF_SkiaFontMgr* pFontMgr, CFPF_SkiaFontDescriptor* pFontDes, const CFX_ByteStringC& bsFamily, diff --git a/core/src/fxge/android/fpf_skiafontmgr.h b/core/src/fxge/android/fpf_skiafontmgr.h index c5dd8fd1b2..17bcb48ca1 100644 --- a/core/src/fxge/android/fpf_skiafontmgr.h +++ b/core/src/fxge/android/fpf_skiafontmgr.h @@ -8,10 +8,14 @@ #define CORE_SRC_FXGE_ANDROID_FPF_SKIAFONTMGR_H_ #if _FX_OS_ == _FX_ANDROID_ + +#include "../../../include/fxge/fpf.h" + #define FPF_SKIAFONTTYPE_Unknown 0 #define FPF_SKIAFONTTYPE_Path 1 #define FPF_SKIAFONTTYPE_File 2 #define FPF_SKIAFONTTYPE_Buffer 3 + class CFPF_SkiaFontDescriptor { public: CFPF_SkiaFontDescriptor() @@ -25,7 +29,9 @@ class CFPF_SkiaFontDescriptor { FX_Free(m_pFamily); } } + virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Unknown; } + void SetFamily(const FX_CHAR* pFamily) { if (m_pFamily) { FX_Free(m_pFamily); @@ -41,15 +47,19 @@ class CFPF_SkiaFontDescriptor { FX_DWORD m_dwCharsets; int32_t m_iGlyphNum; }; + class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor { public: CFPF_SkiaPathFont() : m_pPath(NULL) {} - virtual ~CFPF_SkiaPathFont() { + ~CFPF_SkiaPathFont() override { if (m_pPath) { FX_Free(m_pPath); } } - virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Path; } + + // CFPF_SkiaFontDescriptor + int32_t GetType() const override { return FPF_SKIAFONTTYPE_Path; } + void SetPath(const FX_CHAR* pPath) { if (m_pPath) { FX_Free(m_pPath); @@ -61,33 +71,43 @@ class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor { } FX_CHAR* m_pPath; }; + class CFPF_SkiaFileFont : public CFPF_SkiaFontDescriptor { public: CFPF_SkiaFileFont() : m_pFile(NULL) {} - virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_File; } + + // CFPF_SkiaFontDescriptor + int32_t GetType() const override { return FPF_SKIAFONTTYPE_File; } IFX_FileRead* m_pFile; }; + class CFPF_SkiaBufferFont : public CFPF_SkiaFontDescriptor { public: CFPF_SkiaBufferFont() : m_pBuffer(NULL), m_szBuffer(0) {} - virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Buffer; } + + // CFPF_SkiaFontDescriptor + int32_t GetType() const override { return FPF_SKIAFONTTYPE_Buffer; } + void* m_pBuffer; size_t m_szBuffer; }; + class CFPF_SkiaFontMgr : public IFPF_FontMgr { public: CFPF_SkiaFontMgr(); - virtual ~CFPF_SkiaFontMgr(); + ~CFPF_SkiaFontMgr() override; + + // IFPF_FontMgr + void LoadSystemFonts() override; + void LoadPrivateFont(IFX_FileRead* pFontFile) override; + void LoadPrivateFont(const CFX_ByteStringC& bsFileName) override; + void LoadPrivateFont(void* pBuffer, size_t szBuffer) override; + IFPF_Font* CreateFont(const CFX_ByteStringC& bsFamilyname, + uint8_t uCharset, + FX_DWORD dwStyle, + FX_DWORD dwMatch = 0) override; + FX_BOOL InitFTLibrary(); - virtual void LoadSystemFonts(); - virtual void LoadPrivateFont(IFX_FileRead* pFontFile); - virtual void LoadPrivateFont(const CFX_ByteStringC& bsFileName); - virtual void LoadPrivateFont(void* pBuffer, size_t szBuffer); - - virtual IFPF_Font* CreateFont(const CFX_ByteStringC& bsFamilyname, - uint8_t uCharset, - FX_DWORD dwStyle, - FX_DWORD dwMatch = 0); FXFT_Face GetFontFace(IFX_FileRead* pFileRead, int32_t iFaceIndex = 0); FXFT_Face GetFontFace(const CFX_ByteStringC& bsFile, int32_t iFaceIndex = 0); FXFT_Face GetFontFace(const uint8_t* pBuffer, @@ -104,6 +124,7 @@ class CFPF_SkiaFontMgr : public IFPF_FontMgr { FXFT_Library m_FTLibrary; CFX_MapPtrToPtr m_FamilyFonts; }; + #endif #endif // CORE_SRC_FXGE_ANDROID_FPF_SKIAFONTMGR_H_ diff --git a/core/src/fxge/android/fpf_skiamodule.h b/core/src/fxge/android/fpf_skiamodule.h index 4f1c1193d8..5d1da7be32 100644 --- a/core/src/fxge/android/fpf_skiamodule.h +++ b/core/src/fxge/android/fpf_skiamodule.h @@ -8,13 +8,19 @@ #define CORE_SRC_FXGE_ANDROID_FPF_SKIAMODULE_H_ #if _FX_OS_ == _FX_ANDROID_ + +#include "../../../include/fxge/fpf.h" + class CFPF_SkiaFontMgr; + class CFPF_SkiaDeviceModule : public IFPF_DeviceModule { public: - CFPF_SkiaDeviceModule() : m_pFontMgr(NULL) {} - virtual ~CFPF_SkiaDeviceModule(); - virtual void Destroy(); - virtual IFPF_FontMgr* GetFontMgr(); + CFPF_SkiaDeviceModule() : m_pFontMgr(nullptr) {} + ~CFPF_SkiaDeviceModule() override; + + // IFPF_DeviceModule + void Destroy() override; + IFPF_FontMgr* GetFontMgr() override; protected: CFPF_SkiaFontMgr* m_pFontMgr; |