summaryrefslogtreecommitdiff
path: root/core/fxge/android/fpf_skiamodule.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-13 10:52:11 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-13 10:52:12 -0700
commit6d8e981b51458f0381031fe240f5215db9906622 (patch)
treef36b121dd552a16ef5d8aeba7417fd8f8edfa611 /core/fxge/android/fpf_skiamodule.cpp
parent65ffa4a4ee599194118a0ddf3c26fc3674120b4a (diff)
downloadpdfium-6d8e981b51458f0381031fe240f5215db9906622.tar.xz
Cleanup IFPF_* interfaces.
This CL removes the IFPF_DeviceModule, IFPF_FontMgr and IFPF_Font interfaces in favour of their concrete classes. BUG=pdfium:467 Review URL: https://codereview.chromium.org/1881043004
Diffstat (limited to 'core/fxge/android/fpf_skiamodule.cpp')
-rw-r--r--core/fxge/android/fpf_skiamodule.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/core/fxge/android/fpf_skiamodule.cpp b/core/fxge/android/fpf_skiamodule.cpp
index 0454524829..f219f12499 100644
--- a/core/fxge/android/fpf_skiamodule.cpp
+++ b/core/fxge/android/fpf_skiamodule.cpp
@@ -11,28 +11,36 @@
#include "core/fxge/android/fpf_skiafontmgr.h"
#include "core/fxge/android/fpf_skiamodule.h"
-static IFPF_DeviceModule* gs_pPFModule = NULL;
-IFPF_DeviceModule* FPF_GetDeviceModule() {
- if (!gs_pPFModule) {
+namespace {
+
+CFPF_SkiaDeviceModule* gs_pPFModule = nullptr;
+
+} // namespace
+
+CFPF_SkiaDeviceModule* CFPF_GetSkiaDeviceModule() {
+ if (!gs_pPFModule)
gs_pPFModule = new CFPF_SkiaDeviceModule;
- }
return gs_pPFModule;
}
+
CFPF_SkiaDeviceModule::~CFPF_SkiaDeviceModule() {
delete m_pFontMgr;
}
+
void CFPF_SkiaDeviceModule::Destroy() {
- delete (CFPF_SkiaDeviceModule*)gs_pPFModule;
- gs_pPFModule = NULL;
+ delete gs_pPFModule;
+ gs_pPFModule = nullptr;
}
-IFPF_FontMgr* CFPF_SkiaDeviceModule::GetFontMgr() {
+
+CFPF_SkiaFontMgr* CFPF_SkiaDeviceModule::GetFontMgr() {
if (!m_pFontMgr) {
m_pFontMgr = new CFPF_SkiaFontMgr;
if (!m_pFontMgr->InitFTLibrary()) {
delete m_pFontMgr;
- return NULL;
+ return nullptr;
}
}
- return (IFPF_FontMgr*)m_pFontMgr;
+ return m_pFontMgr;
}
-#endif
+
+#endif // _FX_OS_ == _FX_ANDROID_