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

Unified Diff: core/src/fxge/ge/fx_ge_font.cpp

Issue 809513002: XFA: merge patch from issue 801913002 and 804463003 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 6 years 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
Index: core/src/fxge/ge/fx_ge_font.cpp
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index e3c68e0f65e03125c88974532669fb3769550370..f702e89c6c214e98b522ee31e499ab48beedf3d7 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -54,16 +54,6 @@ FX_BOOL CFX_Font::LoadClone(const CFX_Font* pFont)
m_dwSize = pFont->m_dwSize;
m_pFontData = pFont->m_pFontData;
m_pGsubData = pFont->m_pGsubData;
-#ifdef FOXIT_CHROME_BUILD
- if (pFont->m_pFontDataAllocation) {
- m_pFontDataAllocation = FX_Alloc(FX_BYTE, m_dwSize);
- if (!m_pFontDataAllocation) {
- return FALSE;
- }
- m_pFontData = m_pFontDataAllocation;
- FXSYS_memcpy32(m_pFontDataAllocation, pFont->m_pFontDataAllocation, m_dwSize);
- }
-#endif
m_pPlatformFont = pFont->m_pPlatformFont;
m_pPlatformFontCollection = pFont->m_pPlatformFontCollection;
m_pDwFont = pFont->m_pDwFont;
@@ -78,22 +68,11 @@ CFX_Font::~CFX_Font()
delete m_pSubstFont;
m_pSubstFont = NULL;
}
-#ifdef FOXIT_CHROME_BUILD
- if (m_pFontDataAllocation) {
- FX_Free(m_pFontDataAllocation);
- m_pFontDataAllocation = NULL;
- }
-#endif
if (m_bLogic) {
m_OtfFontData.DetachBuffer();
return;
}
if (m_Face) {
-#ifdef FOXIT_CHROME_BUILD
- if (FXFT_Get_Face_External_Stream(m_Face)) {
- FXFT_Clear_Face_External_Stream(m_Face);
- }
-#endif
if(m_bEmbedded) {
DeleteFace();
} else {
@@ -108,7 +87,7 @@ CFX_Font::~CFX_Font()
FX_Free(m_pGsubData);
m_pGsubData = NULL;
}
-#if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ && (!defined(_FPDFAPI_MINI_)))
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
ReleasePlatformResource();
#endif
}
@@ -194,9 +173,7 @@ FX_BOOL CFX_Font::LoadFile(IFX_FileRead* pFile, int nFaceIndex, int* pFaceCount)
return FALSE;
if (pFaceCount)
*pFaceCount = (int)m_Face->num_faces;
-#ifndef FOXIT_CHROME_BUILD
m_pOwnedStream = stream;
-#endif
FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
return TRUE;
}
@@ -235,7 +212,6 @@ static FXFT_Face FT_LoadFont(FX_LPBYTE pData, int size)
}
FX_BOOL CFX_Font::LoadEmbedded(FX_LPCBYTE data, FX_DWORD size)
{
-#ifdef FOXIT_CHROME_BUILD
m_pFontDataAllocation = FX_Alloc(FX_BYTE, size);
if (!m_pFontDataAllocation) {
return FALSE;
@@ -243,10 +219,6 @@ FX_BOOL CFX_Font::LoadEmbedded(FX_LPCBYTE data, FX_DWORD size)
FXSYS_memcpy32(m_pFontDataAllocation, data, size);
m_Face = FT_LoadFont((FX_LPBYTE)m_pFontDataAllocation, size);
m_pFontData = (FX_LPBYTE)m_pFontDataAllocation;
-#else
- m_Face = FT_LoadFont((FX_LPBYTE)data, size);
- m_pFontData = (FX_LPBYTE)data;
-#endif
m_bEmbedded = TRUE;
m_dwSize = size;
return m_Face != NULL;
« no previous file with comments | « core/src/fxge/fx_freetype/fxft2.5.01/src/psnames/fxft_psmodule.c ('k') | core/src/fxge/ge/fx_ge_fontmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698