Rename functions in core/ that starts with "FPDF_".
Make it clear that these are not functions defined in public/ headers.
Change-Id: Iafa0ec1b9d55ccb269fae7300705e10ae8e5d04a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/65616
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_docpagedata.cpp b/core/fpdfapi/page/cpdf_docpagedata.cpp
index 19d205e..233e2c8 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.cpp
+++ b/core/fpdfapi/page/cpdf_docpagedata.cpp
@@ -66,7 +66,7 @@
InsertWidthArrayImpl(std::move(widths), pWidthArray);
}
-ByteString FPDF_GetPSNameFromTT(HDC hDC) {
+ByteString GetPSNameFromTT(HDC hDC) {
ByteString result;
DWORD size = ::GetFontData(hDC, 'eman', 0, nullptr, 0);
if (size != GDI_ERROR) {
@@ -562,7 +562,7 @@
const bool bCJK = FX_CharSetIsCJK(pLogFont->lfCharSet);
ByteString basefont;
if (bCJK)
- basefont = FPDF_GetPSNameFromTT(hDC);
+ basefont = GetPSNameFromTT(hDC);
if (basefont.IsEmpty())
basefont = pLogFont->lfFaceName;
diff --git a/core/fpdfapi/render/cpdf_imagecacheentry.cpp b/core/fpdfapi/render/cpdf_imagecacheentry.cpp
index 969c505..3805b2d 100644
--- a/core/fpdfapi/render/cpdf_imagecacheentry.cpp
+++ b/core/fpdfapi/render/cpdf_imagecacheentry.cpp
@@ -20,6 +20,20 @@
#include "core/fpdfapi/render/cpdf_renderstatus.h"
#include "core/fxge/dib/cfx_dibitmap.h"
+namespace {
+
+uint32_t GetEstimatedImageSize(const RetainPtr<CFX_DIBBase>& pDIB) {
+ if (!pDIB || !pDIB->GetBuffer())
+ return 0;
+
+ int height = pDIB->GetHeight();
+ ASSERT(pdfium::base::IsValueInRangeForNumericType<uint32_t>(height));
+ return static_cast<uint32_t>(height) * pDIB->GetPitch() +
+ pDIB->GetPaletteSize() * 4;
+}
+
+} // namespace
+
CPDF_ImageCacheEntry::CPDF_ImageCacheEntry(CPDF_Document* pDoc,
const RetainPtr<CPDF_Image>& pImage)
: m_pDocument(pDoc), m_pImage(pImage) {}
@@ -31,17 +45,6 @@
CalcSize();
}
-static uint32_t FPDF_ImageCache_EstimateImageSize(
- const RetainPtr<CFX_DIBBase>& pDIB) {
- if (!pDIB || !pDIB->GetBuffer())
- return 0;
-
- int height = pDIB->GetHeight();
- ASSERT(pdfium::base::IsValueInRangeForNumericType<uint32_t>(height));
- return static_cast<uint32_t>(height) * pDIB->GetPitch() +
- pDIB->GetPaletteSize() * 4;
-}
-
RetainPtr<CFX_DIBBase> CPDF_ImageCacheEntry::DetachBitmap() {
return std::move(m_pCurBitmap);
}
@@ -116,6 +119,6 @@
}
void CPDF_ImageCacheEntry::CalcSize() {
- m_dwCacheSize = FPDF_ImageCache_EstimateImageSize(m_pCachedBitmap) +
- FPDF_ImageCache_EstimateImageSize(m_pCachedMask);
+ m_dwCacheSize = GetEstimatedImageSize(m_pCachedBitmap) +
+ GetEstimatedImageSize(m_pCachedMask);
}
diff --git a/core/fxge/cfx_folderfontinfo.cpp b/core/fxge/cfx_folderfontinfo.cpp
index 032d4de..c93b1f0 100644
--- a/core/fxge/cfx_folderfontinfo.cpp
+++ b/core/fxge/cfx_folderfontinfo.cpp
@@ -54,7 +54,7 @@
}
};
-ByteString FPDF_ReadStringFromFile(FILE* pFile, uint32_t size) {
+ByteString ReadStringFromFile(FILE* pFile, uint32_t size) {
ByteString result;
{
// Span's lifetime must end before ReleaseBuffer() below.
@@ -66,11 +66,11 @@
return result;
}
-ByteString FPDF_LoadTableFromTT(FILE* pFile,
- const uint8_t* pTables,
- uint32_t nTables,
- uint32_t tag,
- uint32_t fileSize) {
+ByteString LoadTableFromTT(FILE* pFile,
+ const uint8_t* pTables,
+ uint32_t nTables,
+ uint32_t tag,
+ uint32_t fileSize) {
for (uint32_t i = 0; i < nTables; i++) {
const uint8_t* p = pTables + i * 16;
if (GET_TT_LONG(p) == tag) {
@@ -80,7 +80,7 @@
offset + size > fileSize || fseek(pFile, offset, SEEK_SET) < 0) {
return ByteString();
}
- return FPDF_ReadStringFromFile(pFile, size);
+ return ReadStringFromFile(pFile, size);
}
}
return ByteString();
@@ -219,12 +219,12 @@
return;
uint32_t nTables = GET_TT_SHORT(buffer + 4);
- ByteString tables = FPDF_ReadStringFromFile(pFile, nTables * 16);
+ ByteString tables = ReadStringFromFile(pFile, nTables * 16);
if (tables.IsEmpty())
return;
- ByteString names = FPDF_LoadTableFromTT(pFile, tables.raw_str(), nTables,
- 0x6e616d65, filesize);
+ ByteString names =
+ LoadTableFromTT(pFile, tables.raw_str(), nTables, 0x6e616d65, filesize);
if (names.IsEmpty())
return;
@@ -241,8 +241,8 @@
auto pInfo = pdfium::MakeUnique<FontFaceInfo>(path, facename, tables, offset,
filesize);
- ByteString os2 = FPDF_LoadTableFromTT(pFile, tables.raw_str(), nTables,
- 0x4f532f32, filesize);
+ ByteString os2 =
+ LoadTableFromTT(pFile, tables.raw_str(), nTables, 0x4f532f32, filesize);
if (os2.GetLength() >= 86) {
const uint8_t* p = os2.raw_str() + 78;
uint32_t codepages = GET_TT_LONG(p);