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