summaryrefslogtreecommitdiff
path: root/core/src/fxge/ge
diff options
context:
space:
mode:
authorJohn Abd-El-Malek <jam@chromium.org>2014-12-15 12:13:45 -0800
committerJohn Abd-El-Malek <jam@chromium.org>2014-12-15 12:13:45 -0800
commit207299b5d46e3e0612dd6a0264fb7647177312bb (patch)
tree796aeeeab94a2cac2676e3fb359078609c82f809 /core/src/fxge/ge
parent0d4fdc1bbf2c23999271617413f89f059d4a71c9 (diff)
downloadpdfium-207299b5d46e3e0612dd6a0264fb7647177312bb.tar.xz
XFA: merge patch from issue 801913002 and 804463003
Simplify PDFium by removing code that's not used in the open source repo. -remove parameter from FPDF_InitLibrary -remove a bunch of ifdefs that are unused Fix build after previous commit. TBR=tsepez@chromium.org BUG= Review URL: https://codereview.chromium.org/809513002
Diffstat (limited to 'core/src/fxge/ge')
-rw-r--r--core/src/fxge/ge/fx_ge_font.cpp30
-rw-r--r--core/src/fxge/ge/fx_ge_fontmap.cpp4
-rw-r--r--core/src/fxge/ge/fx_ge_linux.cpp27
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp14
4 files changed, 6 insertions, 69 deletions
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index e3c68e0f65..f702e89c6c 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;
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index fe790d8664..e27c51fcbb 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -1373,13 +1373,12 @@ CFontFileFaceInfo::~CFontFileFaceInfo()
m_Face = NULL;
}
extern FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream);
-#if defined(_FPDFAPI_MINI_) || _FX_OS_ == _FX_ANDROID_
+#if _FX_OS_ == _FX_ANDROID_
IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
{
return NULL;
}
#endif
-#if !defined(_FPDFAPI_MINI_)
CFX_FolderFontInfo::CFX_FolderFontInfo()
{
}
@@ -1616,4 +1615,3 @@ FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset)
{
return FALSE;
}
-#endif
diff --git a/core/src/fxge/ge/fx_ge_linux.cpp b/core/src/fxge/ge/fx_ge_linux.cpp
index 735ecac0c8..ad0a70ab1f 100644
--- a/core/src/fxge/ge/fx_ge_linux.cpp
+++ b/core/src/fxge/ge/fx_ge_linux.cpp
@@ -7,32 +7,7 @@
#include "../../../include/fxge/fx_ge.h"
#include "../agg/include/fx_agg_driver.h"
#include "text_int.h"
-#if !defined(_FPDFAPI_MINI_) && _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_
-#if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ && (!defined(_FPDFAPI_MINI_)))
-void CFX_AggDeviceDriver::InitPlatform()
-{
-}
-void CFX_AggDeviceDriver::DestroyPlatform()
-{
-}
-void CFX_FaceCache::InitPlatform()
-{
-}
-FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
- CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device,
- FX_FLOAT font_size, FX_DWORD argb)
-{
- return FALSE;
-}
-CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph_Nativetext(CFX_Font* pFont, FX_DWORD glyph_index, const CFX_AffineMatrix* pMatrix,
- int dest_width, int anti_alias)
-{
- return NULL;
-}
-void CFX_Font::ReleasePlatformResource()
-{
-}
-#endif
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_
static const struct {
FX_LPCSTR m_pName;
FX_LPCSTR m_pSubstName;
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index 440ecdd696..0724c10edf 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -135,10 +135,8 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
if (!(text_flags & FXTEXT_PRINTGRAPHICTEXT)) {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
if (!(text_flags & FXFONT_CIDFONT) && pFont->GetPsName().Find(CFX_WideString::FromLocal("+ZJHL")) == -1)
-#ifdef FOXIT_CHROME_BUILD
if (pFont->GetPsName() != CFX_WideString::FromLocal("CNAAJI+cmex10"))
#endif
-#endif
if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, pText2Device, font_size, fill_color, alpha_flag, pIccTransform)) {
return TRUE;
}
@@ -150,10 +148,8 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
} else if (!(text_flags & FXTEXT_NO_NATIVETEXT)) {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
if (!(text_flags & FXFONT_CIDFONT))
-#ifdef FOXIT_CHROME_BUILD
if (pFont->GetPsName() != CFX_WideString::FromLocal("CNAAJI+cmex10"))
#endif
-#endif
if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, pText2Device, font_size, fill_color, alpha_flag, pIccTransform)) {
return TRUE;
}
@@ -1070,7 +1066,7 @@ CFX_FaceCache::~CFX_FaceCache()
}
m_PathMap.RemoveAll();
}
-#if ((_FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_)|| defined(_FPDFAPI_MINI_))
+#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
void CFX_FaceCache::InitPlatform()
{
}
@@ -1105,7 +1101,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD
return NULL;
}
_CFX_UniqueKeyGen keygen;
-#if ((_FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_)|| defined(_FPDFAPI_MINI_))
+#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
if (pFont->GetSubstFont())
keygen.Generate(9, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
(int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias,
@@ -1133,7 +1129,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD
}
#endif
CFX_ByteStringC FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen);
-#if ((_FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_)|| defined(_FPDFAPI_MINI_))
+#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, bFontStyle, dest_width, anti_alias);
#else
if (text_flags & FXTEXT_NO_NATIVETEXT) {
@@ -1186,11 +1182,7 @@ CFX_SizeGlyphCache::~CFX_SizeGlyphCache()
}
m_GlyphMap.RemoveAll();
}
-#if defined(_FPDFAPI_MINI_)
-#define CONTRAST_RAMP_STEP 16
-#else
#define CONTRAST_RAMP_STEP 1
-#endif
void CFX_Font::AdjustMMParams(int glyph_index, int dest_width, int weight)
{
FXFT_MM_Var pMasters = NULL;