From 698aed79d6ad6e8e3a0c7a500c108d69f944b82d Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 26 Sep 2017 16:24:49 -0400 Subject: Cleanup FX macros This CL renames the FX_OS defines to have _OS_ in their names and drops the _DESKTOP suffix. The FXM defines have been changed to just FX. Change-Id: Iab172fba541713b5f6d14fb8098baf68e3364c74 Reviewed-on: https://pdfium-review.googlesource.com/14833 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- core/fxge/agg/fx_agg_driver.cpp | 6 +++--- core/fxge/agg/fx_agg_driver.h | 2 +- core/fxge/cfx_facecache.cpp | 10 +++++----- core/fxge/cfx_folderfontinfo.cpp | 2 +- core/fxge/cfx_font.cpp | 6 +++--- core/fxge/cfx_fontmapper.cpp | 10 +++++----- core/fxge/cfx_renderdevice.cpp | 6 +++--- core/fxge/cfx_renderdevice.h | 2 +- core/fxge/dib/cfx_dibitmap.cpp | 4 ++-- core/fxge/fx_font.h | 4 ++-- core/fxge/fx_ge_fontmap.cpp | 2 +- core/fxge/fx_ge_linux.cpp | 4 ++-- core/fxge/skia/fx_skia_device.cpp | 4 ++-- 13 files changed, 31 insertions(+), 31 deletions(-) (limited to 'core/fxge') diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp index 7f24378feb..b394facace 100644 --- a/core/fxge/agg/fx_agg_driver.cpp +++ b/core/fxge/agg/fx_agg_driver.cpp @@ -1109,7 +1109,7 @@ CFX_AggDeviceDriver::CFX_AggDeviceDriver( const RetainPtr& pOriDevice, bool bGroupKnockout) : m_pBitmap(pBitmap), -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ m_pPlatformGraphics(nullptr), #endif m_FillFlags(0), @@ -1127,7 +1127,7 @@ uint8_t* CFX_AggDeviceDriver::GetBuffer() const { return m_pBitmap->GetBuffer(); } -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ void CFX_AggDeviceDriver::InitPlatform() {} void CFX_AggDeviceDriver::DestroyPlatform() {} @@ -1140,7 +1140,7 @@ bool CFX_AggDeviceDriver::DrawDeviceText(int nChars, uint32_t color) { return false; } -#endif // _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#endif // _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ int CFX_AggDeviceDriver::GetDeviceCaps(int caps_id) const { switch (caps_id) { diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h index 0afc7e3123..92500c3df6 100644 --- a/core/fxge/agg/fx_agg_driver.h +++ b/core/fxge/agg/fx_agg_driver.h @@ -112,7 +112,7 @@ class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { RetainPtr m_pBitmap; std::unique_ptr m_pClipRgn; std::vector> m_StateStack; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ void* m_pPlatformGraphics; #endif int m_FillFlags; diff --git a/core/fxge/cfx_facecache.cpp b/core/fxge/cfx_facecache.cpp index 217c41119c..782e5f9d07 100644 --- a/core/fxge/cfx_facecache.cpp +++ b/core/fxge/cfx_facecache.cpp @@ -24,7 +24,7 @@ #include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkTypeface.h" -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ #include "third_party/skia/include/ports/SkFontMgr.h" #include "third_party/skia/include/ports/SkFontMgr_empty.h" #endif @@ -284,7 +284,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(const CFX_Font* pFont, int nMatrixB = static_cast(pMatrix->b * 10000); int nMatrixC = static_cast(pMatrix->c * 10000); int nMatrixD = static_cast(pMatrix->d * 10000); -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ if (pFont->GetSubstFont()) { keygen.Generate(9, nMatrixA, nMatrixB, nMatrixC, nMatrixD, dest_width, anti_alias, pFont->GetSubstFont()->m_Weight, @@ -317,7 +317,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(const CFX_Font* pFont, } #endif ByteString FaceGlyphsKey(keygen.key_, keygen.key_len_); -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_ || \ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_ || \ defined _SKIA_SUPPORT_PATHS_ return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, bFontStyle, dest_width, anti_alias); @@ -375,7 +375,7 @@ CFX_TypeFace* CFX_FaceCache::GetDeviceCache(const CFX_Font* pFont) { m_pTypeface = SkTypeface::MakeFromStream( new SkMemoryStream(pFont->GetFontData(), pFont->GetSize())); } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ if (!m_pTypeface) { sk_sp customMgr(SkFontMgr_New_Custom_Empty()); m_pTypeface.reset(customMgr->createFromStream( @@ -386,7 +386,7 @@ CFX_TypeFace* CFX_FaceCache::GetDeviceCache(const CFX_Font* pFont) { } #endif -#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ != _FX_PLATFORM_APPLE_ void CFX_FaceCache::InitPlatform() {} #endif diff --git a/core/fxge/cfx_folderfontinfo.cpp b/core/fxge/cfx_folderfontinfo.cpp index 0dc61c998f..f2a19a4c4f 100644 --- a/core/fxge/cfx_folderfontinfo.cpp +++ b/core/fxge/cfx_folderfontinfo.cpp @@ -136,7 +136,7 @@ void CFX_FolderFontInfo::ScanPath(const ByteString& path) { } ByteString fullpath = path; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ fullpath += "\\"; #else fullpath += "/"; diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp index 6e252fc065..87ce9b53ec 100644 --- a/core/fxge/cfx_font.cpp +++ b/core/fxge/cfx_font.cpp @@ -217,7 +217,7 @@ CFX_Font::CFX_Font() m_pFontData(nullptr), m_pGsubData(nullptr), m_dwSize(0), -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ m_pPlatformFont(nullptr), #endif m_bEmbedded(false), @@ -244,7 +244,7 @@ bool CFX_Font::LoadClone(const CFX_Font* pFont) { m_dwSize = pFont->m_dwSize; m_pFontData = pFont->m_pFontData; m_pGsubData = pFont->m_pGsubData; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ m_pPlatformFont = pFont->m_pPlatformFont; #endif m_pOwnedStream = pFont->m_pOwnedStream; @@ -276,7 +276,7 @@ CFX_Font::~CFX_Font() { delete m_pOwnedStream; #endif // PDF_ENABLE_XFA FX_Free(m_pGsubData); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ && !defined _SKIA_SUPPORT_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ && !defined _SKIA_SUPPORT_ ReleasePlatformResource(); #endif } diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp index 4e26c62eeb..ac840ea168 100644 --- a/core/fxge/cfx_fontmapper.cpp +++ b/core/fxge/cfx_fontmapper.cpp @@ -577,13 +577,13 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const ByteString& name, bItalic = italic_angle != 0; weight = old_weight; } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#if _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ const char* narrow_family = "LiberationSansNarrow"; -#elif _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ +#elif _FX_PLATFORM_ == _FX_PLATFORM_ANDROID_ const char* narrow_family = "RobotoCondensed"; #else const char* narrow_family = "ArialNarrow"; -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ auto pos = SubstName.Find("Narrow"); if (pos.has_value() && pos.value() != 0) family = narrow_family; @@ -644,8 +644,8 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const ByteString& name, } } else { if (Charset == FX_CHARSET_Symbol) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || \ - _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ || \ + _FX_PLATFORM_ == _FX_PLATFORM_ANDROID_ if (SubstName == "Symbol") { pSubstFont->m_Family = "Chrome Symbol"; pSubstFont->m_Charset = FX_CHARSET_Symbol; diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp index c6f9411176..9c44fbc1ef 100644 --- a/core/fxge/cfx_renderdevice.cpp +++ b/core/fxge/cfx_renderdevice.cpp @@ -332,7 +332,7 @@ void DrawNormalTextHelper(const RetainPtr& bitmap, } bool ShouldDrawDeviceText(const CFX_Font* pFont, uint32_t text_flags) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (text_flags & FXFONT_CIDFONT) return false; @@ -352,7 +352,7 @@ FXTEXT_CHARPOS::FXTEXT_CHARPOS() : m_Unicode(0), m_GlyphIndex(0), m_FontCharWidth(0), -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ m_ExtGID(0), #endif m_FallbackFontPosition(0), @@ -438,7 +438,7 @@ bool CFX_RenderDevice::CreateCompatibleBitmap( } if (m_RenderCaps & FXRC_BYTEMASK_OUTPUT) return pDIB->Create(width, height, FXDIB_8bppMask); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_PATHS_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_PATHS_ return pDIB->Create( width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Argb : FXDIB_Rgb32); diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h index 4dc8faa466..66fa0a8c6b 100644 --- a/core/fxge/cfx_renderdevice.h +++ b/core/fxge/cfx_renderdevice.h @@ -75,7 +75,7 @@ class FXTEXT_CHARPOS { uint32_t m_Unicode; uint32_t m_GlyphIndex; int32_t m_FontCharWidth; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ uint32_t m_ExtGID; #endif int32_t m_FallbackFontPosition; diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp index 8e105937ee..857ca9a3ce 100644 --- a/core/fxge/dib/cfx_dibitmap.cpp +++ b/core/fxge/dib/cfx_dibitmap.cpp @@ -296,7 +296,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, if (HasAlpha()) { if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) return false; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ } else if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb32)) { #else } else if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb)) { @@ -375,7 +375,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value) { if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) { return false; } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ } else if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb)) { #else } else if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb32)) { diff --git a/core/fxge/fx_font.h b/core/fxge/fx_font.h index e4b085a931..47a8b6084a 100644 --- a/core/fxge/fx_font.h +++ b/core/fxge/fx_font.h @@ -136,7 +136,7 @@ class CFX_Font { bool IsEmbedded() const { return m_bEmbedded; } uint8_t* GetSubData() const { return m_pGsubData; } void SetSubData(uint8_t* data) { m_pGsubData = data; } -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ void* GetPlatformFont() const { return m_pPlatformFont; } void SetPlatformFont(void* font) { m_pPlatformFont = font; } #endif @@ -172,7 +172,7 @@ class CFX_Font { uint8_t* m_pFontData; uint8_t* m_pGsubData; uint32_t m_dwSize; -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ void* m_pPlatformFont; #endif bool m_bEmbedded; diff --git a/core/fxge/fx_ge_fontmap.cpp b/core/fxge/fx_ge_fontmap.cpp index 0f2703875d..b11ee9c6f3 100644 --- a/core/fxge/fx_ge_fontmap.cpp +++ b/core/fxge/fx_ge_fontmap.cpp @@ -72,7 +72,7 @@ unsigned long _FTStreamRead(FXFT_Stream stream, void _FTStreamClose(FXFT_Stream stream); }; -#if _FX_OS_ == _FX_ANDROID_ +#if _FX_OS_ == _FX_OS_ANDROID_ std::unique_ptr IFX_SystemFontInfo::CreateDefault( const char** pUnused) { return nullptr; diff --git a/core/fxge/fx_ge_linux.cpp b/core/fxge/fx_ge_linux.cpp index 650510f63e..302470b386 100644 --- a/core/fxge/fx_ge_linux.cpp +++ b/core/fxge/fx_ge_linux.cpp @@ -13,7 +13,7 @@ #include "core/fxge/ifx_systemfontinfo.h" #include "third_party/base/ptr_util.h" -#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#if _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ namespace { const size_t kLinuxGpNameSize = 6; @@ -162,4 +162,4 @@ void CFX_GEModule::InitPlatform() { } void CFX_GEModule::DestroyPlatform() {} -#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ +#endif // _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 6b82bc217b..c8af215f26 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -870,7 +870,7 @@ class SkiaState { m_positions[index + count] = {cp.m_Origin.x * flip, cp.m_Origin.y * vFlip}; m_glyphs[index + count] = static_cast(cp.m_GlyphIndex); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (cp.m_ExtGID) m_glyphs[index + count] = static_cast(cp.m_ExtGID); #endif @@ -1590,7 +1590,7 @@ bool CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, } } glyphs[index] = static_cast(cp.m_GlyphIndex); -#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ +#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ if (cp.m_ExtGID) glyphs[index] = static_cast(cp.m_ExtGID); #endif -- cgit v1.2.3