OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/fxcrt/fx_system.h" | 7 #include "core/fxge/cfx_gemodule.h" |
8 | |
9 #if _FX_OS_ == _FX_ANDROID_ | |
10 | 8 |
11 #include <memory> | 9 #include <memory> |
12 #include <utility> | 10 #include <utility> |
13 | 11 |
14 #include "core/fxge/android/fpf_skiamodule.h" | 12 #include "core/fxge/android/cfpf_skiadevicemodule.h" |
15 #include "core/fxge/android/fx_android_font.h" | 13 #include "core/fxge/android/cfx_androidfontinfo.h" |
16 #include "core/fxge/cfx_gemodule.h" | |
17 | 14 |
18 void CFX_GEModule::InitPlatform() { | 15 void CFX_GEModule::InitPlatform() { |
19 CFPF_SkiaDeviceModule* pDeviceModule = CFPF_GetSkiaDeviceModule(); | 16 CFPF_SkiaDeviceModule* pDeviceModule = CFPF_GetSkiaDeviceModule(); |
20 if (!pDeviceModule) | 17 if (!pDeviceModule) |
21 return; | 18 return; |
22 | 19 |
23 CFPF_SkiaFontMgr* pFontMgr = pDeviceModule->GetFontMgr(); | 20 CFPF_SkiaFontMgr* pFontMgr = pDeviceModule->GetFontMgr(); |
24 if (pFontMgr) { | 21 if (pFontMgr) { |
25 std::unique_ptr<CFX_AndroidFontInfo> pFontInfo(new CFX_AndroidFontInfo); | 22 std::unique_ptr<CFX_AndroidFontInfo> pFontInfo(new CFX_AndroidFontInfo); |
26 pFontInfo->Init(pFontMgr); | 23 pFontInfo->Init(pFontMgr); |
27 m_pFontMgr->SetSystemFontInfo(std::move(pFontInfo)); | 24 m_pFontMgr->SetSystemFontInfo(std::move(pFontInfo)); |
28 } | 25 } |
29 m_pPlatformData = pDeviceModule; | 26 m_pPlatformData = pDeviceModule; |
30 } | 27 } |
31 | 28 |
32 void CFX_GEModule::DestroyPlatform() { | 29 void CFX_GEModule::DestroyPlatform() { |
33 if (m_pPlatformData) | 30 if (m_pPlatformData) |
34 static_cast<CFPF_SkiaDeviceModule*>(m_pPlatformData)->Destroy(); | 31 static_cast<CFPF_SkiaDeviceModule*>(m_pPlatformData)->Destroy(); |
35 } | 32 } |
36 | |
37 #endif // _FX_OS_ == _FX_ANDROID_ | |
OLD | NEW |