Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
fx_android_impl.cpp
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
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 <memory>
8#include <utility>
9
10#include "core/fxcrt/unowned_ptr.h"
11#include "core/fxge/android/cfpf_skiadevicemodule.h"
12#include "core/fxge/android/cfx_androidfontinfo.h"
13#include "core/fxge/cfx_fontmgr.h"
14#include "core/fxge/cfx_gemodule.h"
15
17 public:
18 CAndroidPlatform() = default;
19 ~CAndroidPlatform() override {
20 if (m_pDeviceModule)
21 m_pDeviceModule->Destroy();
22 }
23
24 void Init() override { m_pDeviceModule = CFPF_GetSkiaDeviceModule(); }
25
27 CFPF_SkiaFontMgr* pFontMgr = m_pDeviceModule->GetFontMgr();
28 if (!pFontMgr)
29 return nullptr;
30
31 auto pFontInfo = std::make_unique<CFX_AndroidFontInfo>();
32 pFontInfo->Init(pFontMgr);
33 return pFontInfo;
34 }
35
36 private:
37 UnownedPtr<CFPF_SkiaDeviceModule> m_pDeviceModule;
38};
39
40// static
41std::unique_ptr<CFX_GEModule::PlatformIface>
43 return std::make_unique<CAndroidPlatform>();
44}
std::unique_ptr< SystemFontInfoIface > CreateDefaultSystemFontInfo() override
~CAndroidPlatform() override
CAndroidPlatform()=default
void Init() override