Name core/fxge/android files appropriately and use one file per class

- Rename files so that they correspond to class names.
- Remove OS_Android ifs, since they are unneeded.
- Split fpf_skiafontmgr.h into classes, one per file.

Review-Url: https://codereview.chromium.org/2448293002
diff --git a/BUILD.gn b/BUILD.gn
index 05408e0..a77ea4c 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -746,14 +746,18 @@
 
 static_library("fxge") {
   sources = [
+    "core/fxge/android/cfpf_skiabufferfont.h",
+    "core/fxge/android/cfpf_skiadevicemodule.cpp",
+    "core/fxge/android/cfpf_skiadevicemodule.h",
+    "core/fxge/android/cfpf_skiafilefont.h",
+    "core/fxge/android/cfpf_skiafont.cpp",
+    "core/fxge/android/cfpf_skiafont.h",
+    "core/fxge/android/cfpf_skiafontdescriptor.h",
     "core/fxge/android/cfpf_skiafontmgr.cpp",
-    "core/fxge/android/fpf_skiafont.cpp",
-    "core/fxge/android/fpf_skiafont.h",
-    "core/fxge/android/fpf_skiafontmgr.h",
-    "core/fxge/android/fpf_skiamodule.cpp",
-    "core/fxge/android/fpf_skiamodule.h",
-    "core/fxge/android/fx_android_font.cpp",
-    "core/fxge/android/fx_android_font.h",
+    "core/fxge/android/cfpf_skiafontmgr.h",
+    "core/fxge/android/cfpf_skiapathfont.h",
+    "core/fxge/android/cfx_androidfontinfo.cpp",
+    "core/fxge/android/cfx_androidfontinfo.h",
     "core/fxge/android/fx_android_imp.cpp",
     "core/fxge/apple/apple_int.h",
     "core/fxge/apple/cfx_quartzdevice.h",
diff --git a/core/fxge/android/cfpf_skiabufferfont.h b/core/fxge/android/cfpf_skiabufferfont.h
new file mode 100644
index 0000000..02fdade
--- /dev/null
+++ b/core/fxge/android/cfpf_skiabufferfont.h
@@ -0,0 +1,25 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FXGE_ANDROID_CFPF_SKIABUFFERFONT_H_
+#define CORE_FXGE_ANDROID_CFPF_SKIABUFFERFONT_H_
+
+#include "core/fxge/android/cfpf_skiafontdescriptor.h"
+
+#define FPF_SKIAFONTTYPE_Buffer 3
+
+class CFPF_SkiaBufferFont : public CFPF_SkiaFontDescriptor {
+ public:
+  CFPF_SkiaBufferFont() : m_pBuffer(nullptr), m_szBuffer(0) {}
+
+  // CFPF_SkiaFontDescriptor
+  int32_t GetType() const override { return FPF_SKIAFONTTYPE_Buffer; }
+
+  void* m_pBuffer;
+  size_t m_szBuffer;
+};
+
+#endif  // CORE_FXGE_ANDROID_CFPF_SKIABUFFERFONT_H_
diff --git a/core/fxge/android/fpf_skiamodule.cpp b/core/fxge/android/cfpf_skiadevicemodule.cpp
similarity index 76%
rename from core/fxge/android/fpf_skiamodule.cpp
rename to core/fxge/android/cfpf_skiadevicemodule.cpp
index e541b24..7bdf646 100644
--- a/core/fxge/android/fpf_skiamodule.cpp
+++ b/core/fxge/android/cfpf_skiadevicemodule.cpp
@@ -1,15 +1,12 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
+// Copyright 2016 PDFium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "core/fxcrt/fx_system.h"
+#include "core/fxge/android/cfpf_skiadevicemodule.h"
 
-#if _FX_OS_ == _FX_ANDROID_
-
-#include "core/fxge/android/fpf_skiafontmgr.h"
-#include "core/fxge/android/fpf_skiamodule.h"
+#include "core/fxge/android/cfpf_skiafontmgr.h"
 
 namespace {
 
@@ -42,5 +39,3 @@
   }
   return m_pFontMgr;
 }
-
-#endif  // _FX_OS_ == _FX_ANDROID_
diff --git a/core/fxge/android/cfpf_skiadevicemodule.h b/core/fxge/android/cfpf_skiadevicemodule.h
new file mode 100644
index 0000000..3261820
--- /dev/null
+++ b/core/fxge/android/cfpf_skiadevicemodule.h
@@ -0,0 +1,26 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FXGE_ANDROID_CFPF_SKIADEVICEMODULE_H_
+#define CORE_FXGE_ANDROID_CFPF_SKIADEVICEMODULE_H_
+
+class CFPF_SkiaFontMgr;
+
+class CFPF_SkiaDeviceModule {
+ public:
+  CFPF_SkiaDeviceModule() : m_pFontMgr(nullptr) {}
+  ~CFPF_SkiaDeviceModule();
+
+  void Destroy();
+  CFPF_SkiaFontMgr* GetFontMgr();
+
+ protected:
+  CFPF_SkiaFontMgr* m_pFontMgr;
+};
+
+CFPF_SkiaDeviceModule* CFPF_GetSkiaDeviceModule();
+
+#endif  // CORE_FXGE_ANDROID_CFPF_SKIADEVICEMODULE_H_
diff --git a/core/fxge/android/cfpf_skiafilefont.h b/core/fxge/android/cfpf_skiafilefont.h
new file mode 100644
index 0000000..b6657bf
--- /dev/null
+++ b/core/fxge/android/cfpf_skiafilefont.h
@@ -0,0 +1,25 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FXGE_ANDROID_CFPF_SKIAFILEFONT_H_
+#define CORE_FXGE_ANDROID_CFPF_SKIAFILEFONT_H_
+
+#include "core/fxge/android/cfpf_skiafontdescriptor.h"
+
+class IFX_SeekableReadStream;
+
+#define FPF_SKIAFONTTYPE_File 2
+
+class CFPF_SkiaFileFont : public CFPF_SkiaFontDescriptor {
+ public:
+  CFPF_SkiaFileFont() : m_pFile(nullptr) {}
+
+  // CFPF_SkiaFontDescriptor
+  int32_t GetType() const override { return FPF_SKIAFONTTYPE_File; }
+  IFX_SeekableReadStream* m_pFile;
+};
+
+#endif  // CORE_FXGE_ANDROID_CFPF_SKIAFILEFONT_H_
diff --git a/core/fxge/android/fpf_skiafont.cpp b/core/fxge/android/cfpf_skiafont.cpp
similarity index 94%
rename from core/fxge/android/fpf_skiafont.cpp
rename to core/fxge/android/cfpf_skiafont.cpp
index 9c19697..c7cfd4d 100644
--- a/core/fxge/android/fpf_skiafont.cpp
+++ b/core/fxge/android/cfpf_skiafont.cpp
@@ -1,15 +1,19 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
+// Copyright 2016 PDFium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "core/fxge/android/fpf_skiafont.h"
+#include "core/fxge/android/cfpf_skiafont.h"
 
 #include <algorithm>
 
 #include "core/fxcrt/fx_system.h"
-#include "core/fxge/android/fpf_skiafontmgr.h"
+#include "core/fxge/android/cfpf_skiabufferfont.h"
+#include "core/fxge/android/cfpf_skiafilefont.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)
diff --git a/core/fxge/android/fpf_skiafont.h b/core/fxge/android/cfpf_skiafont.h
similarity index 88%
rename from core/fxge/android/fpf_skiafont.h
rename to core/fxge/android/cfpf_skiafont.h
index 3adf0c3..ad0245d 100644
--- a/core/fxge/android/fpf_skiafont.h
+++ b/core/fxge/android/cfpf_skiafont.h
@@ -1,11 +1,11 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
+// Copyright 2016 PDFium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef CORE_FXGE_ANDROID_FPF_SKIAFONT_H_
-#define CORE_FXGE_ANDROID_FPF_SKIAFONT_H_
+#ifndef CORE_FXGE_ANDROID_CFPF_SKIAFONT_H_
+#define CORE_FXGE_ANDROID_CFPF_SKIAFONT_H_
 
 #include "core/fxcrt/fx_system.h"
 #include "core/fxge/fx_font.h"
@@ -50,4 +50,4 @@
   uint32_t m_dwRefCount;
 };
 
-#endif  // CORE_FXGE_ANDROID_FPF_SKIAFONT_H_
+#endif  // CORE_FXGE_ANDROID_CFPF_SKIAFONT_H_
diff --git a/core/fxge/android/cfpf_skiafontdescriptor.h b/core/fxge/android/cfpf_skiafontdescriptor.h
new file mode 100644
index 0000000..57b8540
--- /dev/null
+++ b/core/fxge/android/cfpf_skiafontdescriptor.h
@@ -0,0 +1,40 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FXGE_ANDROID_CFPF_SKIAFONTDESCRIPTOR_H_
+#define CORE_FXGE_ANDROID_CFPF_SKIAFONTDESCRIPTOR_H_
+
+#include "core/fxcrt/fx_system.h"
+
+#define FPF_SKIAFONTTYPE_Unknown 0
+
+class CFPF_SkiaFontDescriptor {
+ public:
+  CFPF_SkiaFontDescriptor()
+      : m_pFamily(nullptr),
+        m_dwStyle(0),
+        m_iFaceIndex(0),
+        m_dwCharsets(0),
+        m_iGlyphNum(0) {}
+  virtual ~CFPF_SkiaFontDescriptor() { FX_Free(m_pFamily); }
+
+  virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Unknown; }
+
+  void SetFamily(const FX_CHAR* pFamily) {
+    FX_Free(m_pFamily);
+    int32_t iSize = FXSYS_strlen(pFamily);
+    m_pFamily = FX_Alloc(FX_CHAR, iSize + 1);
+    FXSYS_memcpy(m_pFamily, pFamily, iSize * sizeof(FX_CHAR));
+    m_pFamily[iSize] = 0;
+  }
+  FX_CHAR* m_pFamily;
+  uint32_t m_dwStyle;
+  int32_t m_iFaceIndex;
+  uint32_t m_dwCharsets;
+  int32_t m_iGlyphNum;
+};
+
+#endif  // CORE_FXGE_ANDROID_CFPF_SKIAFONTDESCRIPTOR_H_
diff --git a/core/fxge/android/cfpf_skiafontmgr.cpp b/core/fxge/android/cfpf_skiafontmgr.cpp
index 2deb327..6463e8b 100644
--- a/core/fxge/android/cfpf_skiafontmgr.cpp
+++ b/core/fxge/android/cfpf_skiafontmgr.cpp
@@ -1,10 +1,10 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
+// Copyright 2016 PDFium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "core/fxcrt/fx_system.h"
+#include "core/fxge/android/cfpf_skiafontmgr.h"
 
 #define FPF_SKIAMATCHWEIGHT_NAME1 62
 #define FPF_SKIAMATCHWEIGHT_NAME2 60
@@ -15,8 +15,10 @@
 
 #include "core/fxcrt/fx_ext.h"
 #include "core/fxcrt/fx_memory.h"
-#include "core/fxge/android/fpf_skiafont.h"
-#include "core/fxge/android/fpf_skiafontmgr.h"
+#include "core/fxcrt/fx_system.h"
+#include "core/fxge/android/cfpf_skiafont.h"
+#include "core/fxge/android/cfpf_skiafontdescriptor.h"
+#include "core/fxge/android/cfpf_skiapathfont.h"
 #include "core/fxge/fx_freetype.h"
 
 #ifdef __cplusplus
diff --git a/core/fxge/android/cfpf_skiafontmgr.h b/core/fxge/android/cfpf_skiafontmgr.h
new file mode 100644
index 0000000..7d89c6e
--- /dev/null
+++ b/core/fxge/android/cfpf_skiafontmgr.h
@@ -0,0 +1,52 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FXGE_ANDROID_CFPF_SKIAFONTMGR_H_
+#define CORE_FXGE_ANDROID_CFPF_SKIAFONTMGR_H_
+
+#include <map>
+#include <vector>
+
+#include "core/fxcrt/fx_stream.h"
+#include "core/fxcrt/fx_string.h"
+#include "core/fxge/fx_font.h"
+
+#define FPF_MATCHFONT_REPLACEANSI 1
+
+class CFPF_SkiaFont;
+class CFPF_SkiaFontDescriptor;
+
+class CFPF_SkiaFontMgr {
+ public:
+  CFPF_SkiaFontMgr();
+  ~CFPF_SkiaFontMgr();
+
+  void LoadSystemFonts();
+  CFPF_SkiaFont* CreateFont(const CFX_ByteStringC& bsFamilyname,
+                            uint8_t uCharset,
+                            uint32_t dwStyle,
+                            uint32_t dwMatch = 0);
+
+  bool InitFTLibrary();
+  FXFT_Face GetFontFace(IFX_SeekableReadStream* pFileRead,
+                        int32_t iFaceIndex = 0);
+  FXFT_Face GetFontFace(const CFX_ByteStringC& bsFile, int32_t iFaceIndex = 0);
+  FXFT_Face GetFontFace(const uint8_t* pBuffer,
+                        size_t szBuffer,
+                        int32_t iFaceIndex = 0);
+
+ private:
+  void ScanPath(const CFX_ByteString& path);
+  void ScanFile(const CFX_ByteString& file);
+  void ReportFace(FXFT_Face face, CFPF_SkiaFontDescriptor* pFontDesc);
+
+  bool m_bLoaded;
+  FXFT_Library m_FTLibrary;
+  std::vector<CFPF_SkiaFontDescriptor*> m_FontFaces;
+  std::map<uint32_t, CFPF_SkiaFont*> m_FamilyFonts;
+};
+
+#endif  // CORE_FXGE_ANDROID_CFPF_SKIAFONTMGR_H_
diff --git a/core/fxge/android/cfpf_skiapathfont.h b/core/fxge/android/cfpf_skiapathfont.h
new file mode 100644
index 0000000..f1cff25
--- /dev/null
+++ b/core/fxge/android/cfpf_skiapathfont.h
@@ -0,0 +1,33 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FXGE_ANDROID_CFPF_SKIAPATHFONT_H_
+#define CORE_FXGE_ANDROID_CFPF_SKIAPATHFONT_H_
+
+#include "core/fxcrt/fx_system.h"
+#include "core/fxge/android/cfpf_skiafontdescriptor.h"
+
+#define FPF_SKIAFONTTYPE_Path 1
+
+class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor {
+ public:
+  CFPF_SkiaPathFont() : m_pPath(nullptr) {}
+  ~CFPF_SkiaPathFont() override { FX_Free(m_pPath); }
+
+  // CFPF_SkiaFontDescriptor
+  int32_t GetType() const override { return FPF_SKIAFONTTYPE_Path; }
+
+  void SetPath(const FX_CHAR* pPath) {
+    FX_Free(m_pPath);
+    int32_t iSize = FXSYS_strlen(pPath);
+    m_pPath = FX_Alloc(FX_CHAR, iSize + 1);
+    FXSYS_memcpy(m_pPath, pPath, iSize * sizeof(FX_CHAR));
+    m_pPath[iSize] = 0;
+  }
+  FX_CHAR* m_pPath;
+};
+
+#endif  // CORE_FXGE_ANDROID_CFPF_SKIAPATHFONT_H_
diff --git a/core/fxge/android/fx_android_font.cpp b/core/fxge/android/cfx_androidfontinfo.cpp
similarity index 89%
rename from core/fxge/android/fx_android_font.cpp
rename to core/fxge/android/cfx_androidfontinfo.cpp
index 2ffc897..6db46e2 100644
--- a/core/fxge/android/fx_android_font.cpp
+++ b/core/fxge/android/cfx_androidfontinfo.cpp
@@ -1,16 +1,14 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
+// Copyright 2016 PDFium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
+#include "core/fxge/android/cfx_androidfontinfo.h"
+
 #include "core/fxcrt/fx_system.h"
-
-#if _FX_OS_ == _FX_ANDROID_
-
-#include "core/fxge/android/fpf_skiafont.h"
-#include "core/fxge/android/fpf_skiafontmgr.h"
-#include "core/fxge/android/fx_android_font.h"
+#include "core/fxge/android/cfpf_skiafont.h"
+#include "core/fxge/android/cfpf_skiafontmgr.h"
 #include "core/fxge/cfx_fontmapper.h"
 
 CFX_AndroidFontInfo::CFX_AndroidFontInfo() : m_pFontMgr(nullptr) {}
@@ -87,5 +85,3 @@
 
   static_cast<CFPF_SkiaFont*>(hFont)->Release();
 }
-
-#endif  // _FX_OS_ == _FX_ANDROID_
diff --git a/core/fxge/android/fx_android_font.h b/core/fxge/android/cfx_androidfontinfo.h
similarity index 82%
rename from core/fxge/android/fx_android_font.h
rename to core/fxge/android/cfx_androidfontinfo.h
index 5b75d9d..135a2cd 100644
--- a/core/fxge/android/fx_android_font.h
+++ b/core/fxge/android/cfx_androidfontinfo.h
@@ -1,16 +1,13 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
+// Copyright 2016 PDFium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef CORE_FXGE_ANDROID_FX_ANDROID_FONT_H_
-#define CORE_FXGE_ANDROID_FX_ANDROID_FONT_H_
+#ifndef CORE_FXGE_ANDROID_CFX_ANDROIDFONTINFO_H_
+#define CORE_FXGE_ANDROID_CFX_ANDROIDFONTINFO_H_
 
 #include "core/fxcrt/fx_system.h"
-
-#if _FX_OS_ == _FX_ANDROID_
-
 #include "core/fxge/cfx_fontmapper.h"
 #include "core/fxge/fx_font.h"
 #include "core/fxge/ifx_systemfontinfo.h"
@@ -45,6 +42,4 @@
   CFPF_SkiaFontMgr* m_pFontMgr;
 };
 
-#endif  // _FX_OS_ == _FX_ANDROID_
-
-#endif  // CORE_FXGE_ANDROID_FX_ANDROID_FONT_H_
+#endif  // CORE_FXGE_ANDROID_CFX_ANDROIDFONTINFO_H_
diff --git a/core/fxge/android/fpf_skiafontmgr.h b/core/fxge/android/fpf_skiafontmgr.h
deleted file mode 100644
index 74e7ade..0000000
--- a/core/fxge/android/fpf_skiafontmgr.h
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef CORE_FXGE_ANDROID_FPF_SKIAFONTMGR_H_
-#define CORE_FXGE_ANDROID_FPF_SKIAFONTMGR_H_
-
-#include "core/fxcrt/fx_system.h"
-
-#if _FX_OS_ == _FX_ANDROID_
-
-#include <map>
-#include <vector>
-
-#include "core/fxge/fx_font.h"
-
-#define FPF_SKIAFONTTYPE_Unknown 0
-#define FPF_SKIAFONTTYPE_Path 1
-#define FPF_SKIAFONTTYPE_File 2
-#define FPF_SKIAFONTTYPE_Buffer 3
-
-#define FPF_MATCHFONT_REPLACEANSI 1
-
-class CFPF_SkiaFont;
-
-class CFPF_SkiaFontDescriptor {
- public:
-  CFPF_SkiaFontDescriptor()
-      : m_pFamily(nullptr),
-        m_dwStyle(0),
-        m_iFaceIndex(0),
-        m_dwCharsets(0),
-        m_iGlyphNum(0) {}
-  virtual ~CFPF_SkiaFontDescriptor() { FX_Free(m_pFamily); }
-
-  virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Unknown; }
-
-  void SetFamily(const FX_CHAR* pFamily) {
-    FX_Free(m_pFamily);
-    int32_t iSize = FXSYS_strlen(pFamily);
-    m_pFamily = FX_Alloc(FX_CHAR, iSize + 1);
-    FXSYS_memcpy(m_pFamily, pFamily, iSize * sizeof(FX_CHAR));
-    m_pFamily[iSize] = 0;
-  }
-  FX_CHAR* m_pFamily;
-  uint32_t m_dwStyle;
-  int32_t m_iFaceIndex;
-  uint32_t m_dwCharsets;
-  int32_t m_iGlyphNum;
-};
-
-class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor {
- public:
-  CFPF_SkiaPathFont() : m_pPath(nullptr) {}
-  ~CFPF_SkiaPathFont() override { FX_Free(m_pPath); }
-
-  // CFPF_SkiaFontDescriptor
-  int32_t GetType() const override { return FPF_SKIAFONTTYPE_Path; }
-
-  void SetPath(const FX_CHAR* pPath) {
-    FX_Free(m_pPath);
-    int32_t iSize = FXSYS_strlen(pPath);
-    m_pPath = FX_Alloc(FX_CHAR, iSize + 1);
-    FXSYS_memcpy(m_pPath, pPath, iSize * sizeof(FX_CHAR));
-    m_pPath[iSize] = 0;
-  }
-  FX_CHAR* m_pPath;
-};
-
-class CFPF_SkiaFileFont : public CFPF_SkiaFontDescriptor {
- public:
-  CFPF_SkiaFileFont() : m_pFile(nullptr) {}
-
-  // CFPF_SkiaFontDescriptor
-  int32_t GetType() const override { return FPF_SKIAFONTTYPE_File; }
-  IFX_SeekableReadStream* m_pFile;
-};
-
-class CFPF_SkiaBufferFont : public CFPF_SkiaFontDescriptor {
- public:
-  CFPF_SkiaBufferFont() : m_pBuffer(nullptr), m_szBuffer(0) {}
-
-  // CFPF_SkiaFontDescriptor
-  int32_t GetType() const override { return FPF_SKIAFONTTYPE_Buffer; }
-
-  void* m_pBuffer;
-  size_t m_szBuffer;
-};
-
-class CFPF_SkiaFontMgr {
- public:
-  CFPF_SkiaFontMgr();
-  ~CFPF_SkiaFontMgr();
-
-  void LoadSystemFonts();
-  CFPF_SkiaFont* CreateFont(const CFX_ByteStringC& bsFamilyname,
-                            uint8_t uCharset,
-                            uint32_t dwStyle,
-                            uint32_t dwMatch = 0);
-
-  bool InitFTLibrary();
-  FXFT_Face GetFontFace(IFX_SeekableReadStream* pFileRead,
-                        int32_t iFaceIndex = 0);
-  FXFT_Face GetFontFace(const CFX_ByteStringC& bsFile, int32_t iFaceIndex = 0);
-  FXFT_Face GetFontFace(const uint8_t* pBuffer,
-                        size_t szBuffer,
-                        int32_t iFaceIndex = 0);
-
- private:
-  void ScanPath(const CFX_ByteString& path);
-  void ScanFile(const CFX_ByteString& file);
-  void ReportFace(FXFT_Face face, CFPF_SkiaFontDescriptor* pFontDesc);
-
-  bool m_bLoaded;
-  FXFT_Library m_FTLibrary;
-  std::vector<CFPF_SkiaFontDescriptor*> m_FontFaces;
-  std::map<uint32_t, CFPF_SkiaFont*> m_FamilyFonts;
-};
-
-#endif  // _FX_OS_ == _FX_ANDROID_
-
-#endif  // CORE_FXGE_ANDROID_FPF_SKIAFONTMGR_H_
diff --git a/core/fxge/android/fpf_skiamodule.h b/core/fxge/android/fpf_skiamodule.h
deleted file mode 100644
index a0fb5e0..0000000
--- a/core/fxge/android/fpf_skiamodule.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef CORE_FXGE_ANDROID_FPF_SKIAMODULE_H_
-#define CORE_FXGE_ANDROID_FPF_SKIAMODULE_H_
-
-#include "core/fxcrt/fx_system.h"
-
-#if _FX_OS_ == _FX_ANDROID_
-
-#include "core/fxge/android/fpf_skiafontmgr.h"
-
-class CFPF_SkiaFontMgr;
-
-class CFPF_SkiaDeviceModule {
- public:
-  CFPF_SkiaDeviceModule() : m_pFontMgr(nullptr) {}
-  ~CFPF_SkiaDeviceModule();
-
-  void Destroy();
-  CFPF_SkiaFontMgr* GetFontMgr();
-
- protected:
-  CFPF_SkiaFontMgr* m_pFontMgr;
-};
-
-CFPF_SkiaDeviceModule* CFPF_GetSkiaDeviceModule();
-
-#endif  // _FX_OS_ == _FX_ANDROID_
-
-#endif  // CORE_FXGE_ANDROID_FPF_SKIAMODULE_H_
diff --git a/core/fxge/android/fx_android_imp.cpp b/core/fxge/android/fx_android_imp.cpp
index 6e9dafc..b8e7c5b 100644
--- a/core/fxge/android/fx_android_imp.cpp
+++ b/core/fxge/android/fx_android_imp.cpp
@@ -4,16 +4,13 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "core/fxcrt/fx_system.h"
-
-#if _FX_OS_ == _FX_ANDROID_
+#include "core/fxge/cfx_gemodule.h"
 
 #include <memory>
 #include <utility>
 
-#include "core/fxge/android/fpf_skiamodule.h"
-#include "core/fxge/android/fx_android_font.h"
-#include "core/fxge/cfx_gemodule.h"
+#include "core/fxge/android/cfpf_skiadevicemodule.h"
+#include "core/fxge/android/cfx_androidfontinfo.h"
 
 void CFX_GEModule::InitPlatform() {
   CFPF_SkiaDeviceModule* pDeviceModule = CFPF_GetSkiaDeviceModule();
@@ -33,5 +30,3 @@
   if (m_pPlatformData)
     static_cast<CFPF_SkiaDeviceModule*>(m_pPlatformData)->Destroy();
 }
-
-#endif  // _FX_OS_ == _FX_ANDROID_