Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2440)

Unified Diff: core/include/fxge/fx_dib.h

Issue 1405723003: Sanity check the values of TRUE and FALSE. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: address comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fxcrt/fx_system.h ('k') | core/src/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fxge/fx_dib.h
diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h
index 818aaac5209adbd867aee6ca91b5cc81bd1ccd33..e22ab58065743b7f331347f47a83c6df7ff1ddee 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));
« no previous file with comments | « core/include/fxcrt/fx_system.h ('k') | core/src/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698