summaryrefslogtreecommitdiff
path: root/core/fxge/android/fpf_skiafontmgr.cpp
diff options
context:
space:
mode:
authorjbudorick <jbudorick@chromium.org>2016-06-10 06:28:40 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-10 06:28:40 -0700
commit7f3a15f714c8311b1adb7bdce1ac83c7113af598 (patch)
tree674f11667de8e12b7bdfaf445b2cc99810a306fd /core/fxge/android/fpf_skiafontmgr.cpp
parent855665d4889853f8ac71519de8ff004dba8eb056 (diff)
downloadpdfium-7f3a15f714c8311b1adb7bdce1ac83c7113af598.tar.xz
[Android] Add support for standalone PDFium gn build on Android.
This pulls in the android NDK and catapult, rolls chromium/src/build/, and pulls in two .gni updates. It also fixes a few miscellaneous compile failures in android-specific code. BUG=pdfium:38 Review-Url: https://codereview.chromium.org/2059553002
Diffstat (limited to 'core/fxge/android/fpf_skiafontmgr.cpp')
-rw-r--r--core/fxge/android/fpf_skiafontmgr.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/core/fxge/android/fpf_skiafontmgr.cpp b/core/fxge/android/fpf_skiafontmgr.cpp
index 8a8cc83fb7..fb5b686a87 100644
--- a/core/fxge/android/fpf_skiafontmgr.cpp
+++ b/core/fxge/android/fpf_skiafontmgr.cpp
@@ -30,8 +30,7 @@ static unsigned long FPF_SkiaStream_Read(FXFT_Stream stream,
return 0;
}
if (count > 0) {
- if (pFileRead->ReadBlock(buffer, (FX_FILESIZE)offset, (size_t)count) !=
- count) {
+ if (!pFileRead->ReadBlock(buffer, (FX_FILESIZE)offset, (size_t)count)) {
return 0;
}
}
@@ -209,12 +208,12 @@ static FX_BOOL FPF_SkiaIsCJK(uint8_t uCharset) {
(uCharset == FXFONT_SHIFTJIS_CHARSET);
}
static FX_BOOL FPF_SkiaMaybeSymbol(const CFX_ByteStringC& bsFacename) {
- CFX_ByteString bsName = bsFacename;
+ CFX_ByteString bsName(bsFacename);
bsName.MakeLower();
return bsName.Find("symbol") > -1;
}
static FX_BOOL FPF_SkiaMaybeArabic(const CFX_ByteStringC& bsFacename) {
- CFX_ByteString bsName = bsFacename;
+ CFX_ByteString bsName(bsFacename);
bsName.MakeLower();
return bsName.Find("arabic") > -1;
}
@@ -371,7 +370,7 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const CFX_ByteStringC& bsFile,
}
FXFT_Open_Args args;
args.flags = FT_OPEN_PATHNAME;
- args.pathname = static_cast<FT_String*>(bsFile.c_str());
+ args.pathname = const_cast<FT_String*>(bsFile.c_str());
FXFT_Face face;
if (FXFT_Open_Face(m_FTLibrary, &args, iFaceIndex, &face)) {
return FALSE;
@@ -399,7 +398,7 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const uint8_t* pBuffer,
FXFT_Set_Pixel_Sizes(face, 0, 64);
return face;
}
-void CFPF_SkiaFontMgr::ScanPath(const CFX_ByteStringC& path) {
+void CFPF_SkiaFontMgr::ScanPath(const CFX_ByteString& path) {
void* handle = FX_OpenFolder(path.c_str());
if (!handle) {
return;
@@ -418,7 +417,7 @@ void CFPF_SkiaFontMgr::ScanPath(const CFX_ByteStringC& path) {
continue;
}
}
- CFX_ByteString fullpath = path;
+ CFX_ByteString fullpath(path);
fullpath += "/";
fullpath += filename;
if (bFolder) {
@@ -429,8 +428,8 @@ void CFPF_SkiaFontMgr::ScanPath(const CFX_ByteStringC& path) {
}
FX_CloseFolder(handle);
}
-void CFPF_SkiaFontMgr::ScanFile(const CFX_ByteStringC& file) {
- FXFT_Face face = GetFontFace(file);
+void CFPF_SkiaFontMgr::ScanFile(const CFX_ByteString& file) {
+ FXFT_Face face = GetFontFace(file.AsStringC());
if (face) {
CFPF_SkiaPathFont* pFontDesc = new CFPF_SkiaPathFont;
pFontDesc->SetPath(file.c_str());