diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-08-19 14:13:36 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-08-19 14:13:36 -0700 |
commit | 5417f067844892644486d7b0581c247904059a88 (patch) | |
tree | 34597c3bf0363c807c2cd9226cb7d7537ea60470 /core/src/fxge | |
parent | 7da980351d6fc428fd95be3015081d911f4470c0 (diff) | |
download | pdfium-5417f067844892644486d7b0581c247904059a88.tar.xz |
Merge to XFA: Extern in .cpp file is a code smell, part 2.
(cherry picked from commit c3f4894a6862c74b9ab32b4ec38c531de6ecd83c)
Original Review URL: https://codereview.chromium.org/1298393003 .
Fixed IWYU in core/src/fpdftext/text_int.h exposed by new inclusion.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1294933008 .
Diffstat (limited to 'core/src/fxge')
-rw-r--r-- | core/src/fxge/dib/dib_int.h | 8 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_engine.cpp | 5 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_main.cpp | 9 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_transform.cpp | 17 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_font.cpp | 1 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_fontmap.cpp | 18 | ||||
-rw-r--r-- | core/src/fxge/ge/text_int.h | 2 |
7 files changed, 29 insertions, 31 deletions
diff --git a/core/src/fxge/dib/dib_int.h b/core/src/fxge/dib/dib_int.h index d40e3a4f95..69f28234eb 100644 --- a/core/src/fxge/dib/dib_int.h +++ b/core/src/fxge/dib/dib_int.h @@ -7,6 +7,8 @@ #ifndef CORE_SRC_FXGE_DIB_DIB_INT_H_ #define CORE_SRC_FXGE_DIB_DIB_INT_H_ +extern const int SDP_Table[513]; + class CPDF_FixedMatrix { public: CPDF_FixedMatrix(const CFX_AffineMatrix& src, int bits) { @@ -89,4 +91,10 @@ class CStretchEngine { int m_State; }; +FX_RECT FXDIB_SwapClipBox(FX_RECT& clip, + int width, + int height, + FX_BOOL bFlipX, + FX_BOOL bFlipY); + #endif // CORE_SRC_FXGE_DIB_DIB_INT_H_ diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp index b2da83a802..33c0333788 100644 --- a/core/src/fxge/dib/fx_dib_engine.cpp +++ b/core/src/fxge/dib/fx_dib_engine.cpp @@ -4,11 +4,12 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include <limits.h> + #include "../../../include/fxge/fx_dib.h" #include "../../../include/fxge/fx_ge.h" #include "dib_int.h" -#include <limits.h> -extern int SDP_Table[513]; + void CWeightTable::Calc(int dest_len, int dest_min, int dest_max, diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp index f3e3a23236..d89fec74c4 100644 --- a/core/src/fxge/dib/fx_dib_main.cpp +++ b/core/src/fxge/dib/fx_dib_main.cpp @@ -1578,11 +1578,6 @@ CFX_ImageRenderer::CFX_ImageRenderer() { CFX_ImageRenderer::~CFX_ImageRenderer() { delete m_pTransformer; } -extern FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, - int width, - int height, - FX_BOOL bFlipX, - FX_BOOL bFlipY); FX_BOOL CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn, const CFX_DIBSource* pSource, @@ -1623,8 +1618,8 @@ FX_BOOL CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, int dest_height = image_rect.Height(); FX_RECT bitmap_clip = m_ClipBox; bitmap_clip.Offset(-image_rect.left, -image_rect.top); - bitmap_clip = _FXDIB_SwapClipBox(bitmap_clip, dest_width, dest_height, - m_Matrix.c > 0, m_Matrix.b < 0); + bitmap_clip = FXDIB_SwapClipBox(bitmap_clip, dest_width, dest_height, + m_Matrix.c > 0, m_Matrix.b < 0); m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, m_ClipBox, TRUE, m_Matrix.c > 0, m_Matrix.b < 0, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType); diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp index cbf3bdc82c..7a33f1d9f8 100644 --- a/core/src/fxge/dib/fx_dib_transform.cpp +++ b/core/src/fxge/dib/fx_dib_transform.cpp @@ -6,7 +6,8 @@ #include "../../../include/fxge/fx_dib.h" #include "dib_int.h" -int SDP_Table[513] = { + +const int SDP_Table[513] = { 256, 256, 256, 256, 256, 256, 256, 256, 256, 255, 255, 255, 255, 255, 255, 254, 254, 254, 254, 253, 253, 253, 252, 252, 252, 251, 251, 251, 250, 250, 249, 249, 249, 248, 248, 247, 247, 246, 246, 245, 244, 244, 243, 243, 242, @@ -168,11 +169,11 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, return pTransBitmap; } #define FIX16_005 0.05f -FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, - int width, - int height, - FX_BOOL bFlipX, - FX_BOOL bFlipY) { +FX_RECT FXDIB_SwapClipBox(FX_RECT& clip, + int width, + int height, + FX_BOOL bFlipX, + FX_BOOL bFlipY) { FX_RECT rect; if (bFlipY) { rect.left = height - clip.top; @@ -256,8 +257,8 @@ FX_BOOL CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, int dest_width = result_rect.Width(); int dest_height = result_rect.Height(); result_clip.Offset(-result_rect.left, -result_rect.top); - result_clip = _FXDIB_SwapClipBox(result_clip, dest_width, dest_height, - pDestMatrix->c > 0, pDestMatrix->b < 0); + result_clip = FXDIB_SwapClipBox(result_clip, dest_width, dest_height, + pDestMatrix->c > 0, pDestMatrix->b < 0); m_Stretcher.Start(&m_Storer, pSrc, dest_height, dest_width, result_clip, flags); m_Status = 1; diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp index c3e887146f..c7c4ed2d3d 100644 --- a/core/src/fxge/ge/fx_ge_font.cpp +++ b/core/src/fxge/ge/fx_ge_font.cpp @@ -9,6 +9,7 @@ #include "text_int.h" #define EM_ADJUST(em, a) (em == 0 ? (a) : (a)*1000 / em) + extern void _FPDFAPI_GetInternalFontData(int id1, const uint8_t*& data, FX_DWORD& size); diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index cc4dc07106..af6c43fe9e 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -423,11 +423,6 @@ const FoxitFonts g_FoxitFonts[14] = { {g_FoxitSymbolFontData, 16729}, {g_FoxitDingbatsFontData, 29513}, }; -void _FPDFAPI_GetInternalFontData(int id, - const uint8_t*& data, - FX_DWORD& size) { - CFX_GEModule::Get()->GetFontMgr()->GetStandardFont(data, size, id); -} FX_BOOL CFX_FontMgr::GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index) { @@ -495,8 +490,7 @@ static CFX_ByteString _TT_NormalizeName(const FX_CHAR* family) { norm.MakeLower(); return norm; } -CFX_ByteString _FPDF_GetNameFromTT(const uint8_t* name_table, - FX_DWORD name_id) { +CFX_ByteString GetNameFromTT(const uint8_t* name_table, FX_DWORD name_id) { const uint8_t* ptr = name_table + 2; int name_count = GET_TT_SHORT(ptr); int string_offset = GET_TT_SHORT(ptr + 2); @@ -564,7 +558,7 @@ CFX_ByteString CFX_FontMapper::GetPSNameFromTT(void* hFont) { if (size) { uint8_t* buffer = FX_Alloc(uint8_t, size); m_pFontInfo->GetFontData(hFont, 0x6e616d65, buffer, size); - result = _FPDF_GetNameFromTT(buffer, 6); + result = GetNameFromTT(buffer, 6); FX_Free(buffer); } return result; @@ -1348,10 +1342,6 @@ CFontFileFaceInfo::~CFontFileFaceInfo() { } m_Face = NULL; } -extern FX_BOOL _LoadFile(FXFT_Library library, - FXFT_Face* Face, - IFX_FileRead* pFile, - FXFT_Stream* stream); #if _FX_OS_ == _FX_ANDROID_ IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault() { return NULL; @@ -1465,8 +1455,8 @@ void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, } CFX_ByteString names = _FPDF_LoadTableFromTT(pFile, tables, nTables, 0x6e616d65); - CFX_ByteString facename = _FPDF_GetNameFromTT(names, 1); - CFX_ByteString style = _FPDF_GetNameFromTT(names, 2); + CFX_ByteString facename = GetNameFromTT(names, 1); + CFX_ByteString style = GetNameFromTT(names, 2); if (style != "Regular") { facename += " " + style; } diff --git a/core/src/fxge/ge/text_int.h b/core/src/fxge/ge/text_int.h index b0193c4f2e..2a81f553c4 100644 --- a/core/src/fxge/ge/text_int.h +++ b/core/src/fxge/ge/text_int.h @@ -7,6 +7,8 @@ #ifndef CORE_SRC_FXGE_GE_TEXT_INT_H_ #define CORE_SRC_FXGE_GE_TEXT_INT_H_ +#include "../../../include/fxge/fx_freetype.h" + struct _CFX_UniqueKeyGen { void Generate(int count, ...); FX_CHAR m_Key[128]; |