Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: core/fxge/android/fpf_skiafontmgr.cpp

Issue 2059553002: [Android] Add support for standalone PDFium gn build on Android. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxge/android/fpf_skiafontmgr.h ('k') | core/fxge/android/fpf_skiamodule.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/android/fpf_skiafontmgr.cpp
diff --git a/core/fxge/android/fpf_skiafontmgr.cpp b/core/fxge/android/fpf_skiafontmgr.cpp
index 8a8cc83fb730662b8c0566835d90898df46f710d..fb5b686a87c752c6f3e5170694f8d998ed43a36c 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());
« no previous file with comments | « core/fxge/android/fpf_skiafontmgr.h ('k') | core/fxge/android/fpf_skiamodule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698