summaryrefslogtreecommitdiff
path: root/core
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
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')
-rw-r--r--core/fxge/android/fpf_skiafontmgr.cpp17
-rw-r--r--core/fxge/android/fpf_skiafontmgr.h4
-rw-r--r--core/fxge/android/fpf_skiamodule.h2
-rw-r--r--core/fxge/android/fx_android_font.cpp1
-rw-r--r--core/fxge/android/fx_android_imp.cpp2
5 files changed, 13 insertions, 13 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());
diff --git a/core/fxge/android/fpf_skiafontmgr.h b/core/fxge/android/fpf_skiafontmgr.h
index ec27a7fb21..6e8ebb6e64 100644
--- a/core/fxge/android/fpf_skiafontmgr.h
+++ b/core/fxge/android/fpf_skiafontmgr.h
@@ -111,8 +111,8 @@ class CFPF_SkiaFontMgr {
int32_t iFaceIndex = 0);
protected:
- void ScanPath(const CFX_ByteStringC& path);
- void ScanFile(const CFX_ByteStringC& file);
+ void ScanPath(const CFX_ByteString& path);
+ void ScanFile(const CFX_ByteString& file);
void ReportFace(FXFT_Face face, CFPF_SkiaFontDescriptor* pFontDesc);
void OutputSystemFonts();
diff --git a/core/fxge/android/fpf_skiamodule.h b/core/fxge/android/fpf_skiamodule.h
index 8ad7549cf1..c3d5772fb3 100644
--- a/core/fxge/android/fpf_skiamodule.h
+++ b/core/fxge/android/fpf_skiamodule.h
@@ -7,7 +7,7 @@
#ifndef CORE_FXGE_ANDROID_FPF_SKIAMODULE_H_
#define CORE_FXGE_ANDROID_FPF_SKIAMODULE_H_
-#include "core/fxcrt/include/fx_system.h'"
+#include "core/fxcrt/include/fx_system.h"
#if _FX_OS_ == _FX_ANDROID_
diff --git a/core/fxge/android/fx_android_font.cpp b/core/fxge/android/fx_android_font.cpp
index 3246eb7f9e..c7e876544b 100644
--- a/core/fxge/android/fx_android_font.cpp
+++ b/core/fxge/android/fx_android_font.cpp
@@ -13,6 +13,7 @@
#include "core/fxge/android/fx_android_font.h"
CFX_AndroidFontInfo::CFX_AndroidFontInfo() : m_pFontMgr(nullptr) {}
+CFX_AndroidFontInfo::~CFX_AndroidFontInfo() {}
FX_BOOL CFX_AndroidFontInfo::Init(CFPF_SkiaFontMgr* pFontMgr) {
if (!pFontMgr)
return FALSE;
diff --git a/core/fxge/android/fx_android_imp.cpp b/core/fxge/android/fx_android_imp.cpp
index 08fdea3d89..e4a830ff65 100644
--- a/core/fxge/android/fx_android_imp.cpp
+++ b/core/fxge/android/fx_android_imp.cpp
@@ -31,7 +31,7 @@ void CFX_GEModule::InitPlatform() {
void CFX_GEModule::DestroyPlatform() {
if (m_pPlatformData)
- static_cast<IFPF_DeviceModule*>(m_pPlatformData)->Destroy();
+ static_cast<CFPF_SkiaDeviceModule*>(m_pPlatformData)->Destroy();
}
#endif // _FX_OS_ == _FX_ANDROID_