diff options
Diffstat (limited to 'core/fxge/ge')
-rw-r--r-- | core/fxge/ge/cfx_cliprgn.cpp | 2 | ||||
-rw-r--r-- | core/fxge/ge/cfx_facecache.cpp | 6 | ||||
-rw-r--r-- | core/fxge/ge/cfx_folderfontinfo.cpp | 24 | ||||
-rw-r--r-- | core/fxge/ge/cfx_folderfontinfo.h | 14 | ||||
-rw-r--r-- | core/fxge/ge/cfx_font.cpp | 64 | ||||
-rw-r--r-- | core/fxge/ge/cfx_fontmapper.cpp | 28 | ||||
-rw-r--r-- | core/fxge/ge/cfx_fontmgr.cpp | 12 | ||||
-rw-r--r-- | core/fxge/ge/cfx_pathdata.cpp | 74 | ||||
-rw-r--r-- | core/fxge/ge/cfx_renderdevice.cpp | 258 | ||||
-rw-r--r-- | core/fxge/ge/fx_ge_fontmap.cpp | 2 | ||||
-rw-r--r-- | core/fxge/ge/fx_ge_linux.cpp | 16 |
11 files changed, 249 insertions, 251 deletions
diff --git a/core/fxge/ge/cfx_cliprgn.cpp b/core/fxge/ge/cfx_cliprgn.cpp index ba2605aeca..ea3eb51f18 100644 --- a/core/fxge/ge/cfx_cliprgn.cpp +++ b/core/fxge/ge/cfx_cliprgn.cpp @@ -99,5 +99,5 @@ void CFX_ClipRgn::IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask) { m_Mask = new_mask; return; } - ASSERT(FALSE); + ASSERT(false); } diff --git a/core/fxge/ge/cfx_facecache.cpp b/core/fxge/ge/cfx_facecache.cpp index c297afb664..e7e6e0e42c 100644 --- a/core/fxge/ge/cfx_facecache.cpp +++ b/core/fxge/ge/cfx_facecache.cpp @@ -91,7 +91,7 @@ CFX_FaceCache::~CFX_FaceCache() { CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(const CFX_Font* pFont, uint32_t glyph_index, - FX_BOOL bFontStyle, + bool bFontStyle, const CFX_Matrix* pMatrix, int dest_width, int anti_alias) { @@ -254,7 +254,7 @@ const CFX_PathData* CFX_FaceCache::LoadGlyphPath(const CFX_Font* pFont, const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(const CFX_Font* pFont, uint32_t glyph_index, - FX_BOOL bFontStyle, + bool bFontStyle, const CFX_Matrix* pMatrix, int dest_width, int anti_alias, @@ -369,7 +369,7 @@ CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap( const CFX_Matrix* pMatrix, const CFX_ByteString& FaceGlyphsKey, uint32_t glyph_index, - FX_BOOL bFontStyle, + bool bFontStyle, int dest_width, int anti_alias) { CFX_SizeGlyphCache* pSizeCache; diff --git a/core/fxge/ge/cfx_folderfontinfo.cpp b/core/fxge/ge/cfx_folderfontinfo.cpp index 393f74bbd9..9ccccbc635 100644 --- a/core/fxge/ge/cfx_folderfontinfo.cpp +++ b/core/fxge/ge/cfx_folderfontinfo.cpp @@ -76,7 +76,7 @@ uint32_t GetCharset(int charset) { } int32_t GetSimilarValue(int weight, - FX_BOOL bItalic, + bool bItalic, int pitch_family, uint32_t style) { int32_t iSimilarValue = 0; @@ -108,11 +108,11 @@ void CFX_FolderFontInfo::AddPath(const CFX_ByteStringC& path) { m_PathList.push_back(CFX_ByteString(path)); } -FX_BOOL CFX_FolderFontInfo::EnumFontList(CFX_FontMapper* pMapper) { +bool CFX_FolderFontInfo::EnumFontList(CFX_FontMapper* pMapper) { m_pMapper = pMapper; for (const auto& path : m_PathList) ScanPath(path); - return TRUE; + return true; } void CFX_FolderFontInfo::ScanPath(const CFX_ByteString& path) { @@ -270,11 +270,11 @@ void* CFX_FolderFontInfo::GetSubstFont(const CFX_ByteString& face) { } void* CFX_FolderFontInfo::FindFont(int weight, - FX_BOOL bItalic, + bool bItalic, int charset, int pitch_family, const FX_CHAR* family, - FX_BOOL bMatchName) { + bool bMatchName) { CFX_FontFaceInfo* pFind = nullptr; if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) return GetFont("Courier New"); @@ -301,7 +301,7 @@ void* CFX_FolderFontInfo::FindFont(int weight, } void* CFX_FolderFontInfo::MapFont(int weight, - FX_BOOL bItalic, + bool bItalic, int charset, int pitch_family, const FX_CHAR* family, @@ -312,7 +312,7 @@ void* CFX_FolderFontInfo::MapFont(int weight, #ifdef PDF_ENABLE_XFA void* CFX_FolderFontInfo::MapFontByUnicode(uint32_t dwUnicode, int weight, - FX_BOOL bItalic, + bool bItalic, int pitch_family) { return nullptr; } @@ -364,14 +364,14 @@ uint32_t CFX_FolderFontInfo::GetFontData(void* hFont, } void CFX_FolderFontInfo::DeleteFont(void* hFont) {} -FX_BOOL CFX_FolderFontInfo::GetFaceName(void* hFont, CFX_ByteString& name) { +bool CFX_FolderFontInfo::GetFaceName(void* hFont, CFX_ByteString& name) { if (!hFont) - return FALSE; + return false; CFX_FontFaceInfo* pFont = (CFX_FontFaceInfo*)hFont; name = pFont->m_FaceName; - return TRUE; + return true; } -FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset) { - return FALSE; +bool CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset) { + return false; } diff --git a/core/fxge/ge/cfx_folderfontinfo.h b/core/fxge/ge/cfx_folderfontinfo.h index ef4645cf53..d031eef3d0 100644 --- a/core/fxge/ge/cfx_folderfontinfo.h +++ b/core/fxge/ge/cfx_folderfontinfo.h @@ -22,9 +22,9 @@ class CFX_FolderFontInfo : public IFX_SystemFontInfo { void AddPath(const CFX_ByteStringC& path); // IFX_SytemFontInfo: - FX_BOOL EnumFontList(CFX_FontMapper* pMapper) override; + bool EnumFontList(CFX_FontMapper* pMapper) override; void* MapFont(int weight, - FX_BOOL bItalic, + bool bItalic, int charset, int pitch_family, const FX_CHAR* face, @@ -32,7 +32,7 @@ class CFX_FolderFontInfo : public IFX_SystemFontInfo { #ifdef PDF_ENABLE_XFA void* MapFontByUnicode(uint32_t dwUnicode, int weight, - FX_BOOL bItalic, + bool bItalic, int pitch_family) override; #endif // PDF_ENABLE_XFA void* GetFont(const FX_CHAR* face) override; @@ -41,8 +41,8 @@ class CFX_FolderFontInfo : public IFX_SystemFontInfo { uint8_t* buffer, uint32_t size) override; void DeleteFont(void* hFont) override; - FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) override; - FX_BOOL GetFontCharset(void* hFont, int& charset) override; + bool GetFaceName(void* hFont, CFX_ByteString& name) override; + bool GetFontCharset(void* hFont, int& charset) override; protected: void ScanPath(const CFX_ByteString& path); @@ -53,11 +53,11 @@ class CFX_FolderFontInfo : public IFX_SystemFontInfo { uint32_t offset); void* GetSubstFont(const CFX_ByteString& face); void* FindFont(int weight, - FX_BOOL bItalic, + bool bItalic, int charset, int pitch_family, const FX_CHAR* family, - FX_BOOL bMatchName); + bool bMatchName); std::map<CFX_ByteString, CFX_FontFaceInfo*> m_FontList; std::vector<CFX_ByteString> m_PathList; diff --git a/core/fxge/ge/cfx_font.cpp b/core/fxge/ge/cfx_font.cpp index d1c31d0f51..5604e53e40 100644 --- a/core/fxge/ge/cfx_font.cpp +++ b/core/fxge/ge/cfx_font.cpp @@ -22,7 +22,7 @@ namespace { typedef struct { - FX_BOOL m_bCount; + bool m_bCount; int m_PointCount; FX_PATHPOINT* m_pPoints; int m_CurX; @@ -46,11 +46,11 @@ unsigned long FTStreamRead(FXFT_Stream stream, void FTStreamClose(FXFT_Stream stream) {} -FX_BOOL LoadFileImp(FXFT_Library library, - FXFT_Face* Face, - IFX_SeekableReadStream* pFile, - int32_t faceIndex, - std::unique_ptr<FXFT_StreamRec>* stream) { +bool LoadFileImp(FXFT_Library library, + FXFT_Face* Face, + IFX_SeekableReadStream* pFile, + int32_t faceIndex, + std::unique_ptr<FXFT_StreamRec>* stream) { std::unique_ptr<FXFT_StreamRec> stream1(new FXFT_StreamRec()); stream1->base = nullptr; stream1->size = static_cast<unsigned long>(pFile->GetSize()); @@ -62,10 +62,10 @@ FX_BOOL LoadFileImp(FXFT_Library library, args.flags = FT_OPEN_STREAM; args.stream = stream1.get(); if (FXFT_Open_Face(library, &args, faceIndex, Face)) - return FALSE; + return false; if (stream) *stream = std::move(stream1); - return TRUE; + return true; } #endif // PDF_ENABLE_XFA @@ -240,9 +240,9 @@ CFX_Font::CFX_Font() } #ifdef PDF_ENABLE_XFA -FX_BOOL CFX_Font::LoadClone(const CFX_Font* pFont) { +bool CFX_Font::LoadClone(const CFX_Font* pFont) { if (!pFont) - return FALSE; + return false; m_bShallowCopy = true; if (pFont->m_pSubstFont) { @@ -268,7 +268,7 @@ FX_BOOL CFX_Font::LoadClone(const CFX_Font* pFont) { #endif m_pOwnedStream = pFont->m_pOwnedStream; m_FaceCache = pFont->GetFaceCache(); - return TRUE; + return true; } void CFX_Font::SetFace(FXFT_Face face) { @@ -313,7 +313,7 @@ void CFX_Font::DeleteFace() { } void CFX_Font::LoadSubst(const CFX_ByteString& face_name, - FX_BOOL bTrueType, + bool bTrueType, uint32_t flags, int weight, int italic_angle, @@ -332,10 +332,10 @@ void CFX_Font::LoadSubst(const CFX_ByteString& face_name, } #ifdef PDF_ENABLE_XFA -FX_BOOL CFX_Font::LoadFile(IFX_SeekableReadStream* pFile, - int nFaceIndex, - int* pFaceCount) { - m_bEmbedded = FALSE; +bool CFX_Font::LoadFile(IFX_SeekableReadStream* pFile, + int nFaceIndex, + int* pFaceCount) { + m_bEmbedded = false; CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr(); pFontMgr->InitFTLibrary(); @@ -343,13 +343,13 @@ FX_BOOL CFX_Font::LoadFile(IFX_SeekableReadStream* pFile, std::unique_ptr<FXFT_StreamRec> stream; if (!LoadFileImp(library, &m_Face, pFile, nFaceIndex, &stream)) - return FALSE; + return false; if (pFaceCount) *pFaceCount = (int)m_Face->num_faces; m_pOwnedStream = stream.release(); FXFT_Set_Pixel_Sizes(m_Face, 0, 64); - return TRUE; + return true; } #endif // PDF_ENABLE_XFA @@ -368,7 +368,7 @@ int CFX_Font::GetGlyphWidth(uint32_t glyph_index) { return width; } -FX_BOOL CFX_Font::LoadEmbedded(const uint8_t* data, uint32_t size) { +bool CFX_Font::LoadEmbedded(const uint8_t* data, uint32_t size) { std::vector<uint8_t> temp(data, data + size); m_pFontDataAllocation.swap(temp); m_Face = FT_LoadFont(m_pFontDataAllocation.data(), size); @@ -398,23 +398,23 @@ int CFX_Font::GetDescent() const { FXFT_Get_Face_Descender(m_Face)); } -FX_BOOL CFX_Font::GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox) { +bool CFX_Font::GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox) { if (!m_Face) - return FALSE; + return false; if (FXFT_Is_Face_Tricky(m_Face)) { int error = FXFT_Set_Char_Size(m_Face, 0, 1000 * 64, 72, 72); if (error) - return FALSE; + return false; error = FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH); if (error) - return FALSE; + return false; FXFT_BBox cbox; FT_Glyph glyph; error = FXFT_Get_Glyph(((FXFT_Face)m_Face)->glyph, &glyph); if (error) - return FALSE; + return false; FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox); int pixel_size_x = ((FXFT_Face)m_Face)->size->metrics.x_ppem, pixel_size_y = ((FXFT_Face)m_Face)->size->metrics.y_ppem; @@ -439,7 +439,7 @@ FX_BOOL CFX_Font::GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox) { if (FXFT_Load_Glyph( m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH)) { - return FALSE; + return false; } int em = FXFT_Get_Face_UnitsPerEM(m_Face); if (em == 0) { @@ -457,7 +457,7 @@ FX_BOOL CFX_Font::GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox) { 1000 / em; bbox.bottom = (FXFT_Get_Glyph_HoriBearingY(m_Face)) * 1000 / em; } - return TRUE; + return true; } bool CFX_Font::IsItalic() const { @@ -517,9 +517,9 @@ CFX_ByteString CFX_Font::GetFaceName() const { return m_pSubstFont->m_Family; } -FX_BOOL CFX_Font::GetBBox(FX_RECT& bbox) { +bool CFX_Font::GetBBox(FX_RECT& bbox) { if (!m_Face) - return FALSE; + return false; int em = FXFT_Get_Face_UnitsPerEM(m_Face); if (em == 0) { bbox.left = FXFT_Get_Face_xMin(m_Face); @@ -532,7 +532,7 @@ FX_BOOL CFX_Font::GetBBox(FX_RECT& bbox) { bbox.right = FXFT_Get_Face_xMax(m_Face) * 1000 / em; bbox.bottom = FXFT_Get_Face_yMax(m_Face) * 1000 / em; } - return TRUE; + return true; } int CFX_Font::GetHeight() const { @@ -674,14 +674,14 @@ CFX_PathData* CFX_Font::LoadGlyphPathImpl(uint32_t glyph_index, funcs.shift = 0; funcs.delta = 0; OUTLINE_PARAMS params; - params.m_bCount = TRUE; + params.m_bCount = true; params.m_PointCount = 0; FXFT_Outline_Decompose(FXFT_Get_Glyph_Outline(m_Face), &funcs, ¶ms); if (params.m_PointCount == 0) return nullptr; CFX_PathData* pPath = new CFX_PathData; pPath->SetPointCount(params.m_PointCount); - params.m_bCount = FALSE; + params.m_bCount = false; params.m_PointCount = 0; params.m_pPoints = pPath->GetPoints(); params.m_CurX = params.m_CurY = 0; @@ -695,7 +695,7 @@ CFX_PathData* CFX_Font::LoadGlyphPathImpl(uint32_t glyph_index, } const CFX_GlyphBitmap* CFX_Font::LoadGlyphBitmap(uint32_t glyph_index, - FX_BOOL bFontStyle, + bool bFontStyle, const CFX_Matrix* pMatrix, int dest_width, int anti_alias, diff --git a/core/fxge/ge/cfx_fontmapper.cpp b/core/fxge/ge/cfx_fontmapper.cpp index db40bdbfc7..1b79520373 100644 --- a/core/fxge/ge/cfx_fontmapper.cpp +++ b/core/fxge/ge/cfx_fontmapper.cpp @@ -258,12 +258,12 @@ int32_t GetStyleType(const CFX_ByteString& bsStyle, bool bReverse) { return -1; } -FX_BOOL CheckSupportThirdPartFont(CFX_ByteString name, int& PitchFamily) { +bool CheckSupportThirdPartFont(CFX_ByteString name, int& PitchFamily) { if (name == "MyriadPro") { PitchFamily &= ~FXFONT_FF_ROMAN; - return TRUE; + return true; } - return FALSE; + return false; } void UpdatePitchFamily(uint32_t flags, int& PitchFamily) { @@ -278,7 +278,7 @@ void UpdatePitchFamily(uint32_t flags, int& PitchFamily) { } // namespace CFX_FontMapper::CFX_FontMapper(CFX_FontMgr* mgr) - : m_bListLoaded(FALSE), m_pFontMgr(mgr) { + : m_bListLoaded(false), m_pFontMgr(mgr) { m_MMFaces[0] = nullptr; m_MMFaces[1] = nullptr; FXSYS_memset(m_FoxitFaces, 0, sizeof(m_FoxitFaces)); @@ -328,10 +328,10 @@ void CFX_FontMapper::AddInstalledFont(const CFX_ByteString& name, int charset) { return; const uint8_t* ptr = name.raw_str(); - FX_BOOL bLocalized = FALSE; + bool bLocalized = false; for (int i = 0; i < name.GetLength(); i++) { if (ptr[i] > 0x80) { - bLocalized = TRUE; + bLocalized = true; break; } } @@ -360,7 +360,7 @@ void CFX_FontMapper::LoadInstalledFonts() { return; m_pFontInfo->EnumFontList(this); - m_bListLoaded = TRUE; + m_bListLoaded = true; } CFX_ByteString CFX_FontMapper::MatchInstalledFonts( @@ -422,7 +422,7 @@ FXFT_Face CFX_FontMapper::UseInternalSubst(CFX_SubstFont* pSubstFont, } FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, - FX_BOOL bTrueType, + bool bTrueType, uint32_t flags, int weight, int italic_angle, @@ -714,7 +714,7 @@ FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(uint32_t dwUnicode, if (!m_pFontInfo) return nullptr; - FX_BOOL bItalic = (flags & FXFONT_ITALIC) != 0; + bool bItalic = (flags & FXFONT_ITALIC) != 0; int PitchFamily = 0; UpdatePitchFamily(flags, PitchFamily); void* hFont = @@ -745,16 +745,16 @@ int CFX_FontMapper::GetFaceSize() const { return pdfium::CollectionSize<int>(m_FaceArray); } -FX_BOOL CFX_FontMapper::IsBuiltinFace(const FXFT_Face face) const { +bool CFX_FontMapper::IsBuiltinFace(const FXFT_Face face) const { for (size_t i = 0; i < MM_FACE_COUNT; ++i) { if (m_MMFaces[i] == face) - return TRUE; + return true; } for (size_t i = 0; i < FOXIT_FACE_COUNT; ++i) { if (m_FoxitFaces[i] == face) - return TRUE; + return true; } - return FALSE; + return false; } FXFT_Face CFX_FontMapper::GetCachedTTCFace(void* hFont, @@ -783,7 +783,7 @@ FXFT_Face CFX_FontMapper::GetCachedTTCFace(void* hFont, FXFT_Face CFX_FontMapper::GetCachedFace(void* hFont, CFX_ByteString SubstName, int weight, - FX_BOOL bItalic, + bool bItalic, uint32_t font_size) { FXFT_Face face; uint8_t* pFontData; diff --git a/core/fxge/ge/cfx_fontmgr.cpp b/core/fxge/ge/cfx_fontmgr.cpp index 981a9be288..1d1ebca4a4 100644 --- a/core/fxge/ge/cfx_fontmgr.cpp +++ b/core/fxge/ge/cfx_fontmgr.cpp @@ -45,7 +45,7 @@ const BuiltinFont g_MMFonts[2] = { CFX_ByteString KeyNameFromFace(const CFX_ByteString& face_name, int weight, - FX_BOOL bItalic) { + bool bItalic) { CFX_ByteString key(face_name); key += ','; key += CFX_ByteString::FormatInteger(weight); @@ -110,7 +110,7 @@ void CFX_FontMgr::SetSystemFontInfo( } FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, - FX_BOOL bTrueType, + bool bTrueType, uint32_t flags, int weight, int italic_angle, @@ -123,7 +123,7 @@ FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name, int weight, - FX_BOOL bItalic, + bool bItalic, uint8_t*& pFontData) { auto it = m_FaceMap.find(KeyNameFromFace(face_name, weight, bItalic)); if (it == m_FaceMap.end()) @@ -137,7 +137,7 @@ FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name, FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name, int weight, - FX_BOOL bItalic, + bool bItalic, uint8_t* pData, uint32_t size, int face_index) { @@ -224,14 +224,14 @@ FXFT_Face CFX_FontMgr::GetFileFace(const FX_CHAR* filename, int face_index) { void CFX_FontMgr::ReleaseFace(FXFT_Face face) { if (!face) return; - FX_BOOL bNeedFaceDone = TRUE; + bool bNeedFaceDone = true; auto it = m_FaceMap.begin(); while (it != m_FaceMap.end()) { auto temp = it++; int nRet = temp->second->ReleaseFace(face); if (nRet == -1) continue; - bNeedFaceDone = FALSE; + bNeedFaceDone = false; if (nRet == 0) m_FaceMap.erase(temp); break; diff --git a/core/fxge/ge/cfx_pathdata.cpp b/core/fxge/ge/cfx_pathdata.cpp index 73476bf271..19e8bdb013 100644 --- a/core/fxge/ge/cfx_pathdata.cpp +++ b/core/fxge/ge/cfx_pathdata.cpp @@ -160,8 +160,8 @@ static void _UpdateLineJoinPoints(CFX_FloatRect& rect, FX_FLOAT miter_limit) { FX_FLOAT start_k = 0, start_c = 0, end_k = 0, end_c = 0, start_len = 0, start_dc = 0, end_len = 0, end_dc = 0; - FX_BOOL bStartVert = FXSYS_fabs(start_x - middle_x) < 1.0f / 20; - FX_BOOL bEndVert = FXSYS_fabs(middle_x - end_x) < 1.0f / 20; + bool bStartVert = FXSYS_fabs(start_x - middle_x) < 1.0f / 20; + bool bEndVert = FXSYS_fabs(middle_x - end_x) < 1.0f / 20; if (bStartVert && bEndVert) { int start_dir = middle_y > start_y ? 1 : -1; FX_FLOAT point_y = middle_y + half_width * start_dir; @@ -251,12 +251,12 @@ CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, int iStartPoint = 0; int iEndPoint = 0; int iMiddlePoint = 0; - FX_BOOL bJoin; + bool bJoin; while (iPoint < m_PointCount) { if (m_pPoints[iPoint].m_Flag == FXPT_MOVETO) { iStartPoint = iPoint + 1; iEndPoint = iPoint; - bJoin = FALSE; + bJoin = false; } else { if (m_pPoints[iPoint].m_Flag == FXPT_BEZIERTO) { rect.UpdateRect(m_pPoints[iPoint].m_PointX, m_pPoints[iPoint].m_PointY); @@ -268,12 +268,12 @@ CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, m_pPoints[iPoint + 1].m_Flag == FXPT_MOVETO) { iStartPoint = iPoint - 1; iEndPoint = iPoint; - bJoin = FALSE; + bJoin = false; } else { iStartPoint = iPoint - 1; iMiddlePoint = iPoint; iEndPoint = iPoint + 1; - bJoin = TRUE; + bJoin = true; } } FX_FLOAT start_x = m_pPoints[iStartPoint].m_PointX; @@ -302,12 +302,12 @@ void CFX_PathData::Transform(const CFX_Matrix* pMatrix) { } } -FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, - CFX_Matrix* pMatrix, - FX_BOOL& bThin, - FX_BOOL bAdjust) const { +bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, + CFX_Matrix* pMatrix, + bool& bThin, + bool bAdjust) const { if (m_PointCount < 3) { - return FALSE; + return false; } if (m_PointCount == 3 && (m_pPoints[0].m_Flag & FXPT_TYPE) == FXPT_MOVETO && (m_pPoints[1].m_Flag & FXPT_TYPE) == FXPT_LINETO && @@ -344,13 +344,13 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, } if (m_pPoints[0].m_PointX != m_pPoints[1].m_PointX && m_pPoints[0].m_PointY != m_pPoints[1].m_PointY) { - bThin = TRUE; + bThin = true; } - return TRUE; + return true; } if (((m_PointCount > 3) && (m_PointCount % 2))) { int mid = m_PointCount / 2; - FX_BOOL bZeroArea = FALSE; + bool bZeroArea = false; CFX_PathData t_path; for (int i = 0; i < mid; i++) { if (!(m_pPoints[mid - i - 1].m_PointX == @@ -359,7 +359,7 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, m_pPoints[mid + i + 1].m_PointY && ((m_pPoints[mid - i - 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO && (m_pPoints[mid + i + 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO))) { - bZeroArea = TRUE; + bZeroArea = true; break; } int new_count = t_path.GetPointCount(); @@ -371,8 +371,8 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, } if (!bZeroArea) { NewPath.Append(&t_path, nullptr); - bThin = TRUE; - return TRUE; + bThin = true; + return true; } } int stratPoint = 0; @@ -430,7 +430,7 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, m_pPoints[i - 1].m_PointY, FXPT_MOVETO); NewPath.SetPoint(new_count + 1, m_pPoints[i].m_PointX, m_pPoints[i].m_PointY, FXPT_LINETO); - bThin = TRUE; + bThin = true; } } } else if (point_type == FXPT_BEZIERTO) { @@ -439,17 +439,17 @@ FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, } } if (m_PointCount > 3 && NewPath.GetPointCount()) { - bThin = TRUE; + bThin = true; } if (NewPath.GetPointCount() == 0) { - return FALSE; + return false; } - return TRUE; + return true; } -FX_BOOL CFX_PathData::IsRect() const { +bool CFX_PathData::IsRect() const { if (m_PointCount != 5 && m_PointCount != 4) { - return FALSE; + return false; } if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX || m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) || @@ -457,29 +457,29 @@ FX_BOOL CFX_PathData::IsRect() const { m_pPoints[0].m_PointY == m_pPoints[2].m_PointY) || (m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) { - return FALSE; + return false; } if (m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) { - return FALSE; + return false; } for (int i = 1; i < 4; i++) { if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) { - return FALSE; + return false; } if (m_pPoints[i].m_PointX != m_pPoints[i - 1].m_PointX && m_pPoints[i].m_PointY != m_pPoints[i - 1].m_PointY) { - return FALSE; + return false; } } return m_PointCount == 5 || (m_pPoints[3].m_Flag & FXPT_CLOSEFIGURE); } -FX_BOOL CFX_PathData::IsRect(const CFX_Matrix* pMatrix, - CFX_FloatRect* pRect) const { +bool CFX_PathData::IsRect(const CFX_Matrix* pMatrix, + CFX_FloatRect* pRect) const { if (!pMatrix) { if (!IsRect()) { - return FALSE; + return false; } if (pRect) { pRect->left = m_pPoints[0].m_PointX; @@ -488,20 +488,20 @@ FX_BOOL CFX_PathData::IsRect(const CFX_Matrix* pMatrix, pRect->top = m_pPoints[2].m_PointY; pRect->Normalize(); } - return TRUE; + return true; } if (m_PointCount != 5 && m_PointCount != 4) { - return FALSE; + return false; } if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX || m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) || (m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) { - return FALSE; + return false; } if (m_PointCount == 4 && m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) { - return FALSE; + return false; } FX_FLOAT x[5], y[5]; for (int i = 0; i < m_PointCount; i++) { @@ -509,10 +509,10 @@ FX_BOOL CFX_PathData::IsRect(const CFX_Matrix* pMatrix, y[i]); if (i) { if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) { - return FALSE; + return false; } if (x[i] != x[i - 1] && y[i] != y[i - 1]) { - return FALSE; + return false; } } } @@ -523,7 +523,7 @@ FX_BOOL CFX_PathData::IsRect(const CFX_Matrix* pMatrix, pRect->top = y[2]; pRect->Normalize(); } - return TRUE; + return true; } void CFX_PathData::Copy(const CFX_PathData& src) { diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp index 1c3611ed9b..c6b046b898 100644 --- a/core/fxge/ge/cfx_renderdevice.cpp +++ b/core/fxge/ge/cfx_renderdevice.cpp @@ -393,9 +393,9 @@ CFX_Matrix CFX_RenderDevice::GetCTM() const { return m_pDeviceDriver->GetCTM(); } -FX_BOOL CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, - int width, - int height) const { +bool CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, + int width, + int height) const { if (m_RenderCaps & FXRC_CMYK_OUTPUT) { return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Cmyka @@ -413,37 +413,37 @@ FX_BOOL CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, #endif } -FX_BOOL CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData, - const CFX_Matrix* pObject2Device, - int fill_mode) { +bool CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData, + const CFX_Matrix* pObject2Device, + int fill_mode) { if (!m_pDeviceDriver->SetClip_PathFill(pPathData, pObject2Device, fill_mode)) { - return FALSE; + return false; } UpdateClipBox(); - return TRUE; + return true; } -FX_BOOL CFX_RenderDevice::SetClip_PathStroke( +bool CFX_RenderDevice::SetClip_PathStroke( const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, const CFX_GraphStateData* pGraphState) { if (!m_pDeviceDriver->SetClip_PathStroke(pPathData, pObject2Device, pGraphState)) { - return FALSE; + return false; } UpdateClipBox(); - return TRUE; + return true; } -FX_BOOL CFX_RenderDevice::SetClip_Rect(const FX_RECT& rect) { +bool CFX_RenderDevice::SetClip_Rect(const FX_RECT& rect) { CFX_PathData path; path.AppendRect(rect.left, rect.bottom, rect.right, rect.top); if (!SetClip_PathFill(&path, nullptr, FXFILL_WINDING)) - return FALSE; + return false; UpdateClipBox(); - return TRUE; + return true; } void CFX_RenderDevice::UpdateClipBox() { @@ -455,14 +455,13 @@ void CFX_RenderDevice::UpdateClipBox() { m_ClipBox.bottom = m_Height; } -FX_BOOL CFX_RenderDevice::DrawPathWithBlend( - const CFX_PathData* pPathData, - const CFX_Matrix* pObject2Device, - const CFX_GraphStateData* pGraphState, - uint32_t fill_color, - uint32_t stroke_color, - int fill_mode, - int blend_type) { +bool CFX_RenderDevice::DrawPathWithBlend(const CFX_PathData* pPathData, + const CFX_Matrix* pObject2Device, + const CFX_GraphStateData* pGraphState, + uint32_t fill_color, + uint32_t stroke_color, + int fill_mode, + int blend_type) { uint8_t stroke_alpha = pGraphState ? FXARGB_A(stroke_color) : 0; uint8_t fill_alpha = (fill_mode & 3) ? FXARGB_A(fill_color) : 0; if (stroke_alpha == 0 && pPathData->GetPointCount() == 2) { @@ -480,7 +479,7 @@ FX_BOOL CFX_RenderDevice::DrawPathWithBlend( y2 = pPoints[1].m_PointY; } DrawCosmeticLine(x1, y1, x2, y2, fill_color, fill_mode, blend_type); - return TRUE; + return true; } if ((pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) && stroke_alpha == 0) { @@ -493,7 +492,7 @@ FX_BOOL CFX_RenderDevice::DrawPathWithBlend( // possible to overflow the Width() and Height() calculations. Check that // the rect will have valid dimension before continuing. if (!rect_i.Valid()) - return FALSE; + return false; int width = (int)FXSYS_ceil(rect_f.right - rect_f.left); if (width < 1) { @@ -524,13 +523,13 @@ FX_BOOL CFX_RenderDevice::DrawPathWithBlend( } } if (FillRectWithBlend(&rect_i, fill_color, blend_type)) - return TRUE; + return true; } } if ((fill_mode & 3) && stroke_alpha == 0 && !(fill_mode & FX_FILL_STROKE) && !(fill_mode & FX_FILL_TEXT_MODE)) { CFX_PathData newPath; - FX_BOOL bThin = FALSE; + bool bThin = false; if (pPathData->GetZeroAreaPath(newPath, (CFX_Matrix*)pObject2Device, bThin, !!m_pDeviceDriver->GetDriverType())) { CFX_GraphStateData graphState; @@ -564,16 +563,15 @@ FX_BOOL CFX_RenderDevice::DrawPathWithBlend( } // This can be removed once PDFium entirely relies on Skia -FX_BOOL CFX_RenderDevice::DrawFillStrokePath( - const CFX_PathData* pPathData, - const CFX_Matrix* pObject2Device, - const CFX_GraphStateData* pGraphState, - uint32_t fill_color, - uint32_t stroke_color, - int fill_mode, - int blend_type) { +bool CFX_RenderDevice::DrawFillStrokePath(const CFX_PathData* pPathData, + const CFX_Matrix* pObject2Device, + const CFX_GraphStateData* pGraphState, + uint32_t fill_color, + uint32_t stroke_color, + int fill_mode, + int blend_type) { if (!(m_RenderCaps & FXRC_GET_BITS)) - return FALSE; + return false; CFX_FloatRect bbox; if (pGraphState) { bbox = pPathData->GetBoundingBox(pGraphState->m_LineWidth, @@ -590,14 +588,14 @@ FX_BOOL CFX_RenderDevice::DrawFillStrokePath( CFX_DIBitmap bitmap, Backdrop; if (!CreateCompatibleBitmap(&bitmap, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY))) { - return FALSE; + return false; } if (bitmap.HasAlpha()) { bitmap.Clear(0); Backdrop.Copy(&bitmap); } else { if (!m_pDeviceDriver->GetDIBits(&bitmap, rect.left, rect.top)) - return FALSE; + return false; Backdrop.Copy(&bitmap); } CFX_FxgeDevice bitmap_device; @@ -610,7 +608,7 @@ FX_BOOL CFX_RenderDevice::DrawFillStrokePath( if (!bitmap_device.GetDeviceDriver()->DrawPath( pPathData, &matrix, pGraphState, fill_color, stroke_color, fill_mode, blend_type)) { - return FALSE; + return false; } FX_RECT src_rect(0, 0, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY)); @@ -618,50 +616,50 @@ FX_BOOL CFX_RenderDevice::DrawFillStrokePath( FXDIB_BLEND_NORMAL); } -FX_BOOL CFX_RenderDevice::SetPixel(int x, int y, uint32_t color) { +bool CFX_RenderDevice::SetPixel(int x, int y, uint32_t color) { if (m_pDeviceDriver->SetPixel(x, y, color)) - return TRUE; + return true; FX_RECT rect(x, y, x + 1, y + 1); return FillRectWithBlend(&rect, color, FXDIB_BLEND_NORMAL); } -FX_BOOL CFX_RenderDevice::FillRectWithBlend(const FX_RECT* pRect, - uint32_t fill_color, - int blend_type) { +bool CFX_RenderDevice::FillRectWithBlend(const FX_RECT* pRect, + uint32_t fill_color, + int blend_type) { if (m_pDeviceDriver->FillRectWithBlend(pRect, fill_color, blend_type)) - return TRUE; + return true; if (!(m_RenderCaps & FXRC_GET_BITS)) - return FALSE; + return false; CFX_DIBitmap bitmap; if (!CreateCompatibleBitmap(&bitmap, pRect->Width(), pRect->Height())) - return FALSE; + return false; if (!m_pDeviceDriver->GetDIBits(&bitmap, pRect->left, pRect->top)) - return FALSE; + return false; if (!bitmap.CompositeRect(0, 0, pRect->Width(), pRect->Height(), fill_color, 0, nullptr)) { - return FALSE; + return false; } FX_RECT src_rect(0, 0, pRect->Width(), pRect->Height()); m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, pRect->left, pRect->top, FXDIB_BLEND_NORMAL); - return TRUE; + return true; } -FX_BOOL CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, - FX_FLOAT y1, - FX_FLOAT x2, - FX_FLOAT y2, - uint32_t color, - int fill_mode, - int blend_type) { +bool CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, + FX_FLOAT y1, + FX_FLOAT x2, + FX_FLOAT y2, + uint32_t color, + int fill_mode, + int blend_type) { if ((color >= 0xff000000) && m_pDeviceDriver->DrawCosmeticLine(x1, y1, x2, y2, color, blend_type)) { - return TRUE; + return true; } CFX_GraphStateData graph_state; CFX_PathData path; @@ -672,9 +670,9 @@ FX_BOOL CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, fill_mode, blend_type); } -FX_BOOL CFX_RenderDevice::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top) { +bool CFX_RenderDevice::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top) { if (!(m_RenderCaps & FXRC_GET_BITS)) - return FALSE; + return false; return m_pDeviceDriver->GetDIBits(pBitmap, left, top); } @@ -682,10 +680,10 @@ CFX_DIBitmap* CFX_RenderDevice::GetBackDrop() { return m_pDeviceDriver->GetBackDrop(); } -FX_BOOL CFX_RenderDevice::SetDIBitsWithBlend(const CFX_DIBSource* pBitmap, - int left, - int top, - int blend_mode) { +bool CFX_RenderDevice::SetDIBitsWithBlend(const CFX_DIBSource* pBitmap, + int left, + int top, + int blend_mode) { ASSERT(!pBitmap->IsAlphaMask()); CFX_Matrix ctm = GetCTM(); FX_FLOAT fScaleX = FXSYS_fabs(ctm.a); @@ -695,7 +693,7 @@ FX_BOOL CFX_RenderDevice::SetDIBitsWithBlend(const CFX_DIBSource* pBitmap, FXSYS_round(top + pBitmap->GetHeight() / fScaleY)); dest_rect.Intersect(m_ClipBox); if (dest_rect.IsEmpty()) - return TRUE; + return true; FX_RECT src_rect(dest_rect.left - left, dest_rect.top - top, dest_rect.left - left + dest_rect.Width(), dest_rect.top - top + dest_rect.Height()); @@ -706,23 +704,23 @@ FX_BOOL CFX_RenderDevice::SetDIBitsWithBlend(const CFX_DIBSource* pBitmap, if ((blend_mode != FXDIB_BLEND_NORMAL && !(m_RenderCaps & FXRC_BLEND_MODE)) || (pBitmap->HasAlpha() && !(m_RenderCaps & FXRC_ALPHA_IMAGE))) { if (!(m_RenderCaps & FXRC_GET_BITS)) - return FALSE; + return false; int bg_pixel_width = FXSYS_round(dest_rect.Width() * fScaleX); int bg_pixel_height = FXSYS_round(dest_rect.Height() * fScaleY); CFX_DIBitmap background; if (!background.Create( bg_pixel_width, bg_pixel_height, (m_RenderCaps & FXRC_CMYK_OUTPUT) ? FXDIB_Cmyk : FXDIB_Rgb32)) { - return FALSE; + return false; } if (!m_pDeviceDriver->GetDIBits(&background, dest_rect.left, dest_rect.top)) { - return FALSE; + return false; } if (!background.CompositeBitmap(0, 0, bg_pixel_width, bg_pixel_height, pBitmap, src_rect.left, src_rect.top, - blend_mode, nullptr, FALSE, nullptr)) { - return FALSE; + blend_mode, nullptr, false, nullptr)) { + return false; } FX_RECT rect(0, 0, bg_pixel_width, bg_pixel_height); return m_pDeviceDriver->SetDIBits(&background, 0, &rect, dest_rect.left, @@ -732,7 +730,7 @@ FX_BOOL CFX_RenderDevice::SetDIBitsWithBlend(const CFX_DIBSource* pBitmap, dest_rect.top, blend_mode); } -FX_BOOL CFX_RenderDevice::StretchDIBitsWithFlagsAndBlend( +bool CFX_RenderDevice::StretchDIBitsWithFlagsAndBlend( const CFX_DIBSource* pBitmap, int left, int top, @@ -744,38 +742,38 @@ FX_BOOL CFX_RenderDevice::StretchDIBitsWithFlagsAndBlend( FX_RECT clip_box = m_ClipBox; clip_box.Intersect(dest_rect); if (clip_box.IsEmpty()) - return TRUE; + return true; return m_pDeviceDriver->StretchDIBits(pBitmap, 0, left, top, dest_width, dest_height, &clip_box, flags, blend_mode); } -FX_BOOL CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, - int left, - int top, - uint32_t argb) { +bool CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, + int left, + int top, + uint32_t argb) { FX_RECT src_rect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight()); return m_pDeviceDriver->SetDIBits(pBitmap, argb, &src_rect, left, top, FXDIB_BLEND_NORMAL); } -FX_BOOL CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, - int left, - int top, - int dest_width, - int dest_height, - uint32_t color) { +bool CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, + int left, + int top, + int dest_width, + int dest_height, + uint32_t color) { return StretchBitMaskWithFlags(pBitmap, left, top, dest_width, dest_height, color, 0); } -FX_BOOL CFX_RenderDevice::StretchBitMaskWithFlags(const CFX_DIBSource* pBitmap, - int left, - int top, - int dest_width, - int dest_height, - uint32_t argb, - uint32_t flags) { +bool CFX_RenderDevice::StretchBitMaskWithFlags(const CFX_DIBSource* pBitmap, + int left, + int top, + int dest_width, + int dest_height, + uint32_t argb, + uint32_t flags) { FX_RECT dest_rect(left, top, left + dest_width, top + dest_height); FX_RECT clip_box = m_ClipBox; clip_box.Intersect(dest_rect); @@ -784,18 +782,18 @@ FX_BOOL CFX_RenderDevice::StretchBitMaskWithFlags(const CFX_DIBSource* pBitmap, FXDIB_BLEND_NORMAL); } -FX_BOOL CFX_RenderDevice::StartDIBitsWithBlend(const CFX_DIBSource* pBitmap, - int bitmap_alpha, - uint32_t argb, - const CFX_Matrix* pMatrix, - uint32_t flags, - void*& handle, - int blend_mode) { +bool CFX_RenderDevice::StartDIBitsWithBlend(const CFX_DIBSource* pBitmap, + int bitmap_alpha, + uint32_t argb, + const CFX_Matrix* pMatrix, + uint32_t flags, + void*& handle, + int blend_mode) { return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, flags, handle, blend_mode); } -FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause) { +bool CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause) { return m_pDeviceDriver->ContinueDIBits(handle, pPause); } @@ -819,29 +817,29 @@ bool CFX_RenderDevice::SetBitsWithMask(const CFX_DIBSource* pBitmap, } #endif -FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, - const FXTEXT_CHARPOS* pCharPos, - CFX_Font* pFont, - FX_FLOAT font_size, - const CFX_Matrix* pText2Device, - uint32_t fill_color, - uint32_t text_flags) { +bool CFX_RenderDevice::DrawNormalText(int nChars, + const FXTEXT_CHARPOS* pCharPos, + CFX_Font* pFont, + FX_FLOAT font_size, + const CFX_Matrix* pText2Device, + uint32_t fill_color, + uint32_t text_flags) { int nativetext_flags = text_flags; if (m_DeviceClass != FXDC_DISPLAY) { if (!(text_flags & FXTEXT_PRINTGRAPHICTEXT)) { if (ShouldDrawDeviceText(pFont, text_flags) && m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pText2Device, font_size, fill_color)) { - return TRUE; + return true; } } if (FXARGB_A(fill_color) < 255) - return FALSE; + return false; } else if (!(text_flags & FXTEXT_NO_NATIVETEXT)) { if (ShouldDrawDeviceText(pFont, text_flags) && m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pText2Device, font_size, fill_color)) { - return TRUE; + return true; } } CFX_Matrix char2device; @@ -935,7 +933,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, FXSYS_round((FX_FLOAT)bmp_rect1.bottom / scale_y)); bmp_rect.Intersect(m_ClipBox); if (bmp_rect.IsEmpty()) - return TRUE; + return true; int pixel_width = FXSYS_round(bmp_rect.Width() * scale_x); int pixel_height = FXSYS_round(bmp_rect.Height() * scale_y); int pixel_left = FXSYS_round(bmp_rect.left * scale_x); @@ -943,7 +941,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, if (anti_alias == FXFT_RENDER_MODE_MONO) { CFX_DIBitmap bitmap; if (!bitmap.Create(pixel_width, pixel_height, FXDIB_1bppMask)) - return FALSE; + return false; bitmap.Clear(0); for (const FXTEXT_GLYPHPOS& glyph : glyphs) { if (!glyph.m_pGlyph) @@ -959,15 +957,15 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, CFX_DIBitmap bitmap; if (m_bpp == 8) { if (!bitmap.Create(pixel_width, pixel_height, FXDIB_8bppMask)) - return FALSE; + return false; } else { if (!CreateCompatibleBitmap(&bitmap, pixel_width, pixel_height)) - return FALSE; + return false; } if (!bitmap.HasAlpha() && !bitmap.IsAlphaMask()) { bitmap.Clear(0xFFFFFFFF); if (!GetDIBits(&bitmap, bmp_rect.left, bmp_rect.top)) - return FALSE; + return false; } else { bitmap.Clear(0); if (bitmap.m_pAlphaMask) @@ -989,13 +987,13 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, left += glyph.m_pGlyph->m_Left; left -= pixel_left; if (!left.IsValid()) - return FALSE; + return false; pdfium::base::CheckedNumeric<int> top = glyph.m_OriginY; top -= glyph.m_pGlyph->m_Top; top -= pixel_top; if (!top.IsValid()) - return FALSE; + return false; const CFX_DIBitmap* pGlyph = &glyph.m_pGlyph->m_Bitmap; int ncols = pGlyph->GetWidth(); @@ -1003,9 +1001,9 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, if (anti_alias == FXFT_RENDER_MODE_NORMAL) { if (!bitmap.CompositeMask(left.ValueOrDie(), top.ValueOrDie(), ncols, nrows, pGlyph, fill_color, 0, 0, - FXDIB_BLEND_NORMAL, nullptr, FALSE, 0, + FXDIB_BLEND_NORMAL, nullptr, false, 0, nullptr)) { - return FALSE; + return false; } continue; } @@ -1016,7 +1014,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, pdfium::base::CheckedNumeric<int> end_col_safe = left; end_col_safe += ncols; if (!end_col_safe.IsValid()) - return FALSE; + return false; int end_col = std::min(end_col_safe.ValueOrDie(), dest_width); if (start_col >= end_col) @@ -1030,20 +1028,20 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, SetBitMask(&bitmap, bmp_rect.left, bmp_rect.top, fill_color); else SetDIBits(&bitmap, bmp_rect.left, bmp_rect.top); - return TRUE; + return true; } -FX_BOOL CFX_RenderDevice::DrawTextPath(int nChars, - const FXTEXT_CHARPOS* pCharPos, - CFX_Font* pFont, - FX_FLOAT font_size, - const CFX_Matrix* pText2User, - const CFX_Matrix* pUser2Device, - const CFX_GraphStateData* pGraphState, - uint32_t fill_color, - FX_ARGB stroke_color, - CFX_PathData* pClippingPath, - int nFlag) { +bool CFX_RenderDevice::DrawTextPath(int nChars, + const FXTEXT_CHARPOS* pCharPos, + CFX_Font* pFont, + FX_FLOAT font_size, + const CFX_Matrix* pText2User, + const CFX_Matrix* pUser2Device, + const CFX_GraphStateData* pGraphState, + uint32_t fill_color, + FX_ARGB stroke_color, + CFX_PathData* pClippingPath, + int nFlag) { for (int iChar = 0; iChar < nChars; iChar++) { const FXTEXT_CHARPOS& charpos = pCharPos[iChar]; CFX_Matrix matrix; @@ -1068,11 +1066,11 @@ FX_BOOL CFX_RenderDevice::DrawTextPath(int nChars, if (!DrawPathWithBlend(&TransformedPath, pUser2Device, pGraphState, fill_color, stroke_color, fill_mode, FXDIB_BLEND_NORMAL)) { - return FALSE; + return false; } } if (pClippingPath) pClippingPath->Append(&TransformedPath, pUser2Device); } - return TRUE; + return true; } diff --git a/core/fxge/ge/fx_ge_fontmap.cpp b/core/fxge/ge/fx_ge_fontmap.cpp index eed5d929b9..f8c36d8f07 100644 --- a/core/fxge/ge/fx_ge_fontmap.cpp +++ b/core/fxge/ge/fx_ge_fontmap.cpp @@ -52,7 +52,7 @@ CFX_ByteString GetNameFromTT(const uint8_t* name_table, #ifdef PDF_ENABLE_XFA void* IFX_SystemFontInfo::MapFontByUnicode(uint32_t dwUnicode, int weight, - FX_BOOL bItalic, + bool bItalic, int pitch_family) { return nullptr; } diff --git a/core/fxge/ge/fx_ge_linux.cpp b/core/fxge/ge/fx_ge_linux.cpp index 47cee34766..0319dd8ef5 100644 --- a/core/fxge/ge/fx_ge_linux.cpp +++ b/core/fxge/ge/fx_ge_linux.cpp @@ -21,12 +21,12 @@ namespace { class CFX_LinuxFontInfo : public CFX_FolderFontInfo { public: void* MapFont(int weight, - FX_BOOL bItalic, + bool bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact) override; - FX_BOOL ParseFontCfg(const char** pUserPaths); + bool ParseFontCfg(const char** pUserPaths); }; const size_t kLinuxGpNameSize = 6; @@ -82,7 +82,7 @@ size_t GetJapanesePreference(const FX_CHAR* facearr, } // namespace void* CFX_LinuxFontInfo::MapFont(int weight, - FX_BOOL bItalic, + bool bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, @@ -92,7 +92,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, iExact = 1; return font; } - FX_BOOL bCJK = TRUE; + bool bCJK = true; switch (charset) { case FXFONT_SHIFTJIS_CHARSET: { size_t index = GetJapanesePreference(cstr_face, weight, pitch_family); @@ -133,7 +133,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, break; } default: - bCJK = FALSE; + bCJK = false; break; } return FindFont(weight, bItalic, charset, pitch_family, cstr_face, !bCJK); @@ -151,13 +151,13 @@ std::unique_ptr<IFX_SystemFontInfo> IFX_SystemFontInfo::CreateDefault( return std::unique_ptr<IFX_SystemFontInfo>(pInfo); } -FX_BOOL CFX_LinuxFontInfo::ParseFontCfg(const char** pUserPaths) { +bool CFX_LinuxFontInfo::ParseFontCfg(const char** pUserPaths) { if (!pUserPaths) - return FALSE; + return false; for (const char** pPath = pUserPaths; *pPath; ++pPath) AddPath(*pPath); - return TRUE; + return true; } void CFX_GEModule::InitPlatform() { |