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/include/fxge/fx_dib.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/include/fxge') diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h index 818aaac520..e22ab58065 100644 --- a/core/include/fxge/fx_dib.h +++ b/core/include/fxge/fx_dib.h @@ -196,13 +196,16 @@ class CFX_DIBSource { int GetBPP() const { return m_bpp; } + // TODO(thestig): Investigate this. Given the possible values of FXDIB_Format, + // it feels as though this should be implemented as !!(m_AlphaFlag & 1) and + // IsOpaqueImage() below should never be able to return TRUE. FX_BOOL IsAlphaMask() const { return m_AlphaFlag == 1; } - FX_BOOL HasAlpha() const { return m_AlphaFlag & 2 ? TRUE : FALSE; } + FX_BOOL HasAlpha() const { return !!(m_AlphaFlag & 2); } FX_BOOL IsOpaqueImage() const { return !(m_AlphaFlag & 3); } - FX_BOOL IsCmykImage() const { return m_AlphaFlag & 4 ? TRUE : FALSE; } + FX_BOOL IsCmykImage() const { return !!(m_AlphaFlag & 4); } int GetPaletteSize() const { return IsAlphaMask() ? 0 : (m_bpp == 1 ? 2 : (m_bpp == 8 ? 256 : 0)); -- cgit v1.2.3