summaryrefslogtreecommitdiff
path: root/core/src/fxge
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-26 14:31:56 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-26 14:31:56 -0800
commit007e6c0f9559412788b903bcb6a7601e220c3be8 (patch)
treea2c6bb85eaa2b63fd24ed70fd3c6ddad54e219d5 /core/src/fxge
parent281a9eadff15b167e2ee3032e21b83190ad49125 (diff)
downloadpdfium-007e6c0f9559412788b903bcb6a7601e220c3be8.tar.xz
Remove some FX_BOOLs
Grepping for FX_BOOL and |==| on the same line gives a very strong clue that the expression won't be out of range of the |bool| type iteself. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1736323003 .
Diffstat (limited to 'core/src/fxge')
-rw-r--r--core/src/fxge/android/fpf_skiafontmgr.cpp4
-rw-r--r--core/src/fxge/dib/fx_dib_composite.cpp2
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp4
-rw-r--r--core/src/fxge/win32/fx_win32_device.cpp3
4 files changed, 6 insertions, 7 deletions
diff --git a/core/src/fxge/android/fpf_skiafontmgr.cpp b/core/src/fxge/android/fpf_skiafontmgr.cpp
index 2d4a2c726b..b37343b9e5 100644
--- a/core/src/fxge/android/fpf_skiafontmgr.cpp
+++ b/core/src/fxge/android/fpf_skiafontmgr.cpp
@@ -280,7 +280,7 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname,
if (dwFaceName == dwSysFontName) {
nFind += FPF_SKIAMATCHWEIGHT_NAME1;
}
- FX_BOOL bMatchedName = (nFind == FPF_SKIAMATCHWEIGHT_NAME1);
+ bool bMatchedName = (nFind == FPF_SKIAMATCHWEIGHT_NAME1);
if ((dwStyle & FXFONT_BOLD) == (pFontDes->m_dwStyle & FXFONT_BOLD)) {
nFind += FPF_SKIAMATCHWEIGHT_1;
}
@@ -299,7 +299,7 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname,
}
if (dwSubst == dwSysFontName || dwSubstSans == dwSysFontName) {
nFind += FPF_SKIAMATCHWEIGHT_NAME2;
- bMatchedName = TRUE;
+ bMatchedName = true;
}
if (uCharset == FXFONT_DEFAULT_CHARSET || bMaybeSymbol) {
if (nFind > nMax && bMatchedName) {
diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp
index 6068dffe75..8bf36e523a 100644
--- a/core/src/fxge/dib/fx_dib_composite.cpp
+++ b/core/src/fxge/dib/fx_dib_composite.cpp
@@ -4907,7 +4907,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left,
}
int Bpp = m_bpp / 8;
FX_BOOL bAlpha = HasAlpha();
- FX_BOOL bArgb = GetFormat() == FXDIB_Argb;
+ bool bArgb = GetFormat() == FXDIB_Argb;
if (src_alpha == 255) {
for (int row = rect.top; row < rect.bottom; row++) {
uint8_t* dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index ae426b093c..8d54363d14 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -1173,7 +1173,7 @@ CFX_FontCache::~CFX_FontCache() {
CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont) {
FXFT_Face internal_face = pFont->GetFace();
- const FX_BOOL bExternal = internal_face == nullptr;
+ const bool bExternal = !internal_face;
FXFT_Face face =
bExternal ? (FXFT_Face)pFont->GetSubstFont()->m_ExtHandle : internal_face;
CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
@@ -1194,7 +1194,7 @@ CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont) {
void CFX_FontCache::ReleaseCachedFace(CFX_Font* pFont) {
FXFT_Face internal_face = pFont->GetFace();
- const FX_BOOL bExternal = internal_face == nullptr;
+ const bool bExternal = !internal_face;
FXFT_Face face =
bExternal ? (FXFT_Face)pFont->GetSubstFont()->m_ExtHandle : internal_face;
CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index 58f8769ac7..e9fee082b9 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -1103,8 +1103,7 @@ FX_BOOL CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource,
int alpha = FXGETFLAG_COLORTYPE(alpha_flag)
? FXGETFLAG_ALPHA_FILL(alpha_flag)
: FXARGB_A(color);
- FX_BOOL bGDI = pSource->GetBPP() == 1 && alpha == 255;
- if (!bGDI) {
+ if (pSource->GetBPP() != 1 || alpha != 255) {
CFX_DIBitmap background;
if (!background.Create(width, height, FXDIB_Rgb32) ||
!GetDIBits(&background, left, top, NULL) ||