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

Side by Side Diff: core/src/fxge/dib/fx_dib_convert.cpp

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 unified diff | Download patch
« no previous file with comments | « core/src/fxge/dib/fx_dib_composite.cpp ('k') | core/src/fxge/win32/fx_win32_dwrite.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../../include/fxge/fx_dib.h" 7 #include "../../../include/fxge/fx_dib.h"
8 #include "../../../include/fxge/fx_ge.h" 8 #include "../../../include/fxge/fx_ge.h"
9 #include "../../../include/fxcodec/fx_codec.h" 9 #include "../../../include/fxcodec/fx_codec.h"
10 const FX_DWORD g_dwWinPalette[256] = { 10 const FX_DWORD g_dwWinPalette[256] = {
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 } 1089 }
1090 return pClone; 1090 return pClone;
1091 } 1091 }
1092 CFX_DIBitmap* pClone = new CFX_DIBitmap; 1092 CFX_DIBitmap* pClone = new CFX_DIBitmap;
1093 if (!pClone->Create(m_Width, m_Height, dest_format)) { 1093 if (!pClone->Create(m_Width, m_Height, dest_format)) {
1094 delete pClone; 1094 delete pClone;
1095 return NULL; 1095 return NULL;
1096 } 1096 }
1097 FX_BOOL ret = TRUE; 1097 FX_BOOL ret = TRUE;
1098 CFX_DIBitmap* pSrcAlpha = NULL; 1098 CFX_DIBitmap* pSrcAlpha = NULL;
1099 if (m_AlphaFlag & 2) { 1099 if (HasAlpha()) {
1100 pSrcAlpha = (GetFormat() == FXDIB_Argb) ? GetAlphaMask() : m_pAlphaMask; 1100 pSrcAlpha = (GetFormat() == FXDIB_Argb) ? GetAlphaMask() : m_pAlphaMask;
1101 if (pSrcAlpha == NULL) { 1101 if (pSrcAlpha == NULL) {
1102 delete pClone; 1102 delete pClone;
1103 return NULL; 1103 return NULL;
1104 } 1104 }
1105 } 1105 }
1106 if (dest_format & 0x0200) { 1106 if (dest_format & 0x0200) {
1107 if (dest_format == FXDIB_Argb) 1107 if (dest_format == FXDIB_Argb)
1108 ret = pSrcAlpha ? pClone->LoadChannel(FXDIB_Alpha, pSrcAlpha, FXDIB_Alpha) 1108 ret = pSrcAlpha ? pClone->LoadChannel(FXDIB_Alpha, pSrcAlpha, FXDIB_Alpha)
1109 : pClone->LoadChannel(FXDIB_Alpha, 0xff); 1109 : pClone->LoadChannel(FXDIB_Alpha, 0xff);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 if (!m_bExtBuf) { 1217 if (!m_bExtBuf) {
1218 FX_Free(m_pBuffer); 1218 FX_Free(m_pBuffer);
1219 } 1219 }
1220 m_bExtBuf = FALSE; 1220 m_bExtBuf = FALSE;
1221 m_pBuffer = dest_buf; 1221 m_pBuffer = dest_buf;
1222 m_bpp = (uint8_t)dest_format; 1222 m_bpp = (uint8_t)dest_format;
1223 m_AlphaFlag = (uint8_t)(dest_format >> 8); 1223 m_AlphaFlag = (uint8_t)(dest_format >> 8);
1224 m_Pitch = dest_pitch; 1224 m_Pitch = dest_pitch;
1225 return TRUE; 1225 return TRUE;
1226 } 1226 }
OLDNEW
« no previous file with comments | « core/src/fxge/dib/fx_dib_composite.cpp ('k') | core/src/fxge/win32/fx_win32_dwrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698