summaryrefslogtreecommitdiff
path: root/core/fxge/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge/android')
-rw-r--r--core/fxge/android/fx_android_font.h41
-rw-r--r--core/fxge/android/fx_android_imp.cpp7
2 files changed, 25 insertions, 23 deletions
diff --git a/core/fxge/android/fx_android_font.h b/core/fxge/android/fx_android_font.h
index 07d5f5852b..c9c68e347a 100644
--- a/core/fxge/android/fx_android_font.h
+++ b/core/fxge/android/fx_android_font.h
@@ -18,29 +18,28 @@ class CFPF_SkiaFontMgr;
class CFX_AndroidFontInfo : public IFX_SystemFontInfo {
public:
CFX_AndroidFontInfo();
- virtual void Release() { delete this; }
-
- virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper);
-
- virtual void* MapFont(int weight,
- FX_BOOL bItalic,
- int charset,
- int pitch_family,
- const FX_CHAR* face,
- int& bExact);
-
- virtual void* GetFont(const FX_CHAR* face);
- virtual uint32_t GetFontData(void* hFont,
- uint32_t table,
- uint8_t* buffer,
- uint32_t size);
- virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name);
- virtual FX_BOOL GetFontCharset(void* hFont, int& charset);
-
- virtual void DeleteFont(void* hFont);
- virtual void* RetainFont(void* hFont);
+ ~CFX_AndroidFontInfo() override;
+
FX_BOOL Init(CFPF_SkiaFontMgr* pFontMgr);
+ // IFX_SystemFontInfo:
+ FX_BOOL EnumFontList(CFX_FontMapper* pMapper) override;
+ void* MapFont(int weight,
+ FX_BOOL bItalic,
+ int charset,
+ int pitch_family,
+ const FX_CHAR* face,
+ int& bExact) override;
+ void* GetFont(const FX_CHAR* face) override;
+ uint32_t GetFontData(void* hFont,
+ uint32_t table,
+ uint8_t* buffer,
+ uint32_t size) override;
+ 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/android/fx_android_imp.cpp b/core/fxge/android/fx_android_imp.cpp
index bbaa2ba27a..08fdea3d89 100644
--- a/core/fxge/android/fx_android_imp.cpp
+++ b/core/fxge/android/fx_android_imp.cpp
@@ -8,6 +8,9 @@
#if _FX_OS_ == _FX_ANDROID_
+#include <memory>
+#include <utility>
+
#include "core/fxge/android/fpf_skiamodule.h"
#include "core/fxge/android/fx_android_font.h"
#include "core/fxge/include/fx_ge.h"
@@ -19,9 +22,9 @@ void CFX_GEModule::InitPlatform() {
CFPF_SkiaFontMgr* pFontMgr = pDeviceModule->GetFontMgr();
if (pFontMgr) {
- CFX_AndroidFontInfo* pFontInfo = new CFX_AndroidFontInfo;
+ std::unique_ptr<CFX_AndroidFontInfo> pFontInfo(new CFX_AndroidFontInfo);
pFontInfo->Init(pFontMgr);
- m_pFontMgr->SetSystemFontInfo(pFontInfo);
+ m_pFontMgr->SetSystemFontInfo(std::move(pFontInfo));
}
m_pPlatformData = pDeviceModule;
}