summaryrefslogtreecommitdiff
path: root/core/fxge/android/cfpf_skiafontmgr.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-17 19:29:51 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-17 19:29:51 +0000
commite13a068f29061b9c6d24189bc4dc87a9111cdb1b (patch)
tree0ee44a6d076ce7fb4db75e04ef5a1ae5cf58cd46 /core/fxge/android/cfpf_skiafontmgr.cpp
parent3a6d058740a9908a06efb9e9362df01acdee6ff8 (diff)
downloadpdfium-e13a068f29061b9c6d24189bc4dc87a9111cdb1b.tar.xz
Remove CFPF_SkiaBufferFont and CFPF_SkiaFileFont.
The classes are never instantiated. Change-Id: I108d3c397464e50b337bc46702d4adbc263e8814 Reviewed-on: https://pdfium-review.googlesource.com/40550 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/android/cfpf_skiafontmgr.cpp')
-rw-r--r--core/fxge/android/cfpf_skiafontmgr.cpp66
1 files changed, 1 insertions, 65 deletions
diff --git a/core/fxge/android/cfpf_skiafontmgr.cpp b/core/fxge/android/cfpf_skiafontmgr.cpp
index 880de6bc01..32fe498882 100644
--- a/core/fxge/android/cfpf_skiafontmgr.cpp
+++ b/core/fxge/android/cfpf_skiafontmgr.cpp
@@ -16,6 +16,7 @@
#include "core/fxcrt/fx_codepage.h"
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/fx_memory.h"
+#include "core/fxcrt/fx_stream.h"
#include "core/fxcrt/fx_system.h"
#include "core/fxge/android/cfpf_skiafont.h"
#include "core/fxge/android/cfpf_skiafontdescriptor.h"
@@ -24,28 +25,6 @@
namespace {
-unsigned long FPF_SkiaStream_Read(FXFT_Stream stream,
- unsigned long offset,
- unsigned char* buffer,
- unsigned long count) {
- if (count == 0)
- return 0;
-
- IFX_SeekableReadStream* pFileRead =
- static_cast<IFX_SeekableReadStream*>(stream->descriptor.pointer);
- if (!pFileRead)
- return 0;
-
- if (!pFileRead->ReadBlock(buffer, static_cast<FX_FILESIZE>(offset),
- static_cast<size_t>(count))) {
- return 0;
- }
-
- return count;
-}
-
-void FPF_SkiaStream_Close(FXFT_Stream stream) {}
-
struct FPF_SKIAFONTMAP {
uint32_t dwFamily;
uint32_t dwSubSt;
@@ -356,31 +335,6 @@ CFPF_SkiaFont* CFPF_SkiaFontMgr::CreateFont(const ByteStringView& bsFamilyname,
return nullptr;
}
-FXFT_Face CFPF_SkiaFontMgr::GetFontFace(
- const RetainPtr<IFX_SeekableReadStream>& pFileRead,
- int32_t iFaceIndex) {
- if (!pFileRead)
- return nullptr;
- if (pFileRead->GetSize() == 0)
- return nullptr;
- if (iFaceIndex < 0)
- return nullptr;
- FXFT_StreamRec streamRec;
- memset(&streamRec, 0, sizeof(FXFT_StreamRec));
- streamRec.size = pFileRead->GetSize();
- streamRec.descriptor.pointer = static_cast<void*>(pFileRead.Get());
- streamRec.read = FPF_SkiaStream_Read;
- streamRec.close = FPF_SkiaStream_Close;
- FXFT_Open_Args args;
- args.flags = FT_OPEN_STREAM;
- args.stream = &streamRec;
- FXFT_Face face;
- if (FXFT_Open_Face(m_FTLibrary, &args, iFaceIndex, &face))
- return nullptr;
- FXFT_Set_Pixel_Sizes(face, 0, 64);
- return face;
-}
-
FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const ByteStringView& bsFile,
int32_t iFaceIndex) {
if (bsFile.IsEmpty())
@@ -397,24 +351,6 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const ByteStringView& bsFile,
return face;
}
-FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const uint8_t* pBuffer,
- size_t szBuffer,
- int32_t iFaceIndex) {
- if (!pBuffer || szBuffer < 1)
- return nullptr;
- if (iFaceIndex < 0)
- return nullptr;
- FXFT_Open_Args args;
- args.flags = FT_OPEN_MEMORY;
- args.memory_base = pBuffer;
- args.memory_size = szBuffer;
- FXFT_Face face;
- if (FXFT_Open_Face(m_FTLibrary, &args, iFaceIndex, &face))
- return nullptr;
- FXFT_Set_Pixel_Sizes(face, 0, 64);
- return face;
-}
-
void CFPF_SkiaFontMgr::ScanPath(const ByteString& path) {
DIR* handle = FX_OpenFolder(path.c_str());
if (!handle)