summaryrefslogtreecommitdiff
path: root/core/src/fxge
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-19 12:11:49 -0700
committerLei Zhang <thestig@chromium.org>2015-10-19 12:11:49 -0700
commitb0748bb1b207559deaec7a5f49c00c492a5f6082 (patch)
treeb4eb849c5d68388f74ca0e1006895e415f004a43 /core/src/fxge
parent29cd8b9631408c0360c744e23a2733d24c9224ec (diff)
downloadpdfium-b0748bb1b207559deaec7a5f49c00c492a5f6082.tar.xz
Merge to XFA: Sanity check the values of TRUE and FALSE.
Get rid of cond ? TRUE : FALSE. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1405723003 . (cherry picked from commit aff4635dad81bc319266d9d84b81552580cd2b65) Review URL: https://codereview.chromium.org/1412793003 .
Diffstat (limited to 'core/src/fxge')
-rw-r--r--core/src/fxge/dib/fx_dib_composite.cpp6
-rw-r--r--core/src/fxge/dib/fx_dib_convert.cpp2
-rw-r--r--core/src/fxge/win32/fx_win32_dwrite.cpp2
3 files changed, 5 insertions, 5 deletions
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 3884d0fc8e..d29f00923d 100644
--- a/core/src/fxge/dib/fx_dib_convert.cpp
+++ b/core/src/fxge/dib/fx_dib_convert.cpp
@@ -1100,7 +1100,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;
diff --git a/core/src/fxge/win32/fx_win32_dwrite.cpp b/core/src/fxge/win32/fx_win32_dwrite.cpp
index 5a3c16c2af..0a78dbf1cd 100644
--- a/core/src/fxge/win32/fx_win32_dwrite.cpp
+++ b/core/src/fxge/win32/fx_win32_dwrite.cpp
@@ -240,7 +240,7 @@ FX_BOOL CDWriteExt::DwRendingString(void* renderTarget,
stringRect, pClipRgn, pMatrix ? &transform : NULL, baselineOriginX,
baselineOriginY, DWRITE_MEASURING_MODE_NATURAL, &glyphRun,
RGB(FXARGB_R(text_color), FXARGB_G(text_color), FXARGB_B(text_color)));
- return SUCCEEDED(hr) ? TRUE : FALSE;
+ return SUCCEEDED(hr);
}
void CDWriteExt::DwDeleteRenderingTarget(void* renderTarget) {
delete (CDwGdiTextRenderer*)renderTarget;