From aff4635dad81bc319266d9d84b81552580cd2b65 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 19 Oct 2015 12:00:05 -0700 Subject: Sanity check the values of TRUE and FALSE. Get rid of cond ? TRUE : FALSE. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1405723003 . --- core/src/fxge/dib/fx_dib_composite.cpp | 6 +++--- core/src/fxge/dib/fx_dib_convert.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'core/src/fxge/dib') diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp index 89a52f3dba..85741fdc54 100644 --- a/core/src/fxge/dib/fx_dib_composite.cpp +++ b/core/src/fxge/dib/fx_dib_composite.cpp @@ -4056,8 +4056,8 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, void* icc_module, void* pIccTransform) { ICodec_IccModule* pIccModule = (ICodec_IccModule*)icc_module; - FX_BOOL isSrcCmyk = src_format & 0x0400 ? TRUE : FALSE; - FX_BOOL isDstCmyk = dest_format & 0x0400 ? TRUE : FALSE; + FX_BOOL isSrcCmyk = !!(src_format & 0x0400); + FX_BOOL isDstCmyk = !!(dest_format & 0x0400); pDestPalette = NULL; if (pIccTransform) { if (pSrcPalette) { @@ -4912,7 +4912,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, } int Bpp = m_bpp / 8; FX_BOOL bAlpha = HasAlpha(); - FX_BOOL bArgb = GetFormat() == FXDIB_Argb ? TRUE : FALSE; + FX_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/dib/fx_dib_convert.cpp b/core/src/fxge/dib/fx_dib_convert.cpp index 4b50a0cdf3..7e7a619595 100644 --- a/core/src/fxge/dib/fx_dib_convert.cpp +++ b/core/src/fxge/dib/fx_dib_convert.cpp @@ -1096,7 +1096,7 @@ CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, } FX_BOOL ret = TRUE; CFX_DIBitmap* pSrcAlpha = NULL; - if (m_AlphaFlag & 2) { + if (HasAlpha()) { pSrcAlpha = (GetFormat() == FXDIB_Argb) ? GetAlphaMask() : m_pAlphaMask; if (pSrcAlpha == NULL) { delete pClone; -- cgit v1.2.3