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

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

Issue 1512763013: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits Created 5 years 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/fxcrt/xml_int.h ('k') | core/src/fxge/ge/fx_ge_device.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 "core/include/fxge/fx_dib.h" 7 #include "core/include/fxge/fx_dib.h"
8 8
9 #include <limits.h> 9 #include <limits.h>
10 10
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 if (!pSrcBitmap->IsAlphaMask()) { 837 if (!pSrcBitmap->IsAlphaMask()) {
838 return FALSE; 838 return FALSE;
839 } 839 }
840 if (!IsAlphaMask() && !HasAlpha()) { 840 if (!IsAlphaMask() && !HasAlpha()) {
841 return LoadChannel(FXDIB_Alpha, pSrcBitmap, FXDIB_Alpha); 841 return LoadChannel(FXDIB_Alpha, pSrcBitmap, FXDIB_Alpha);
842 } 842 }
843 CFX_DIBitmap* pSrcClone = (CFX_DIBitmap*)pSrcBitmap; 843 CFX_DIBitmap* pSrcClone = (CFX_DIBitmap*)pSrcBitmap;
844 if (pSrcBitmap->GetWidth() != m_Width || 844 if (pSrcBitmap->GetWidth() != m_Width ||
845 pSrcBitmap->GetHeight() != m_Height) { 845 pSrcBitmap->GetHeight() != m_Height) {
846 pSrcClone = pSrcBitmap->StretchTo(m_Width, m_Height); 846 pSrcClone = pSrcBitmap->StretchTo(m_Width, m_Height);
847 ASSERT(pSrcClone != NULL);
848 if (pSrcClone == NULL) { 847 if (pSrcClone == NULL) {
849 return FALSE; 848 return FALSE;
850 } 849 }
851 } 850 }
852 if (IsAlphaMask()) { 851 if (IsAlphaMask()) {
853 if (!ConvertFormat(FXDIB_8bppMask)) { 852 if (!ConvertFormat(FXDIB_8bppMask)) {
854 if (pSrcClone != pSrcBitmap) { 853 if (pSrcClone != pSrcBitmap) {
855 delete pSrcClone; 854 delete pSrcClone;
856 } 855 }
857 return FALSE; 856 return FALSE;
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 } 1332 }
1334 } 1333 }
1335 return TRUE; 1334 return TRUE;
1336 } 1335 }
1337 FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, 1336 FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette,
1338 int pal_size, 1337 int pal_size,
1339 const FX_RECT* pRect) { 1338 const FX_RECT* pRect) {
1340 if (m_pBuffer == NULL) { 1339 if (m_pBuffer == NULL) {
1341 return FALSE; 1340 return FALSE;
1342 } 1341 }
1343 if (m_bpp != 8 && m_pPalette != NULL && m_AlphaFlag != 0) { 1342 if (m_bpp != 8 && m_pPalette && m_AlphaFlag != 0) {
1344 return FALSE; 1343 return FALSE;
1345 } 1344 }
1346 if (m_Width < 4 && m_Height < 4) { 1345 if (m_Width < 4 && m_Height < 4) {
1347 return FALSE; 1346 return FALSE;
1348 } 1347 }
1349 FX_RECT rect(0, 0, m_Width, m_Height); 1348 FX_RECT rect(0, 0, m_Width, m_Height);
1350 if (pRect) { 1349 if (pRect) {
1351 rect.Intersect(*pRect); 1350 rect.Intersect(*pRect);
1352 } 1351 }
1353 uint8_t translate[256]; 1352 uint8_t translate[256];
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1716 if (!m_pBitmap->Create(width, height, src_format)) { 1715 if (!m_pBitmap->Create(width, height, src_format)) {
1717 delete m_pBitmap; 1716 delete m_pBitmap;
1718 m_pBitmap = NULL; 1717 m_pBitmap = NULL;
1719 return FALSE; 1718 return FALSE;
1720 } 1719 }
1721 if (pSrcPalette) { 1720 if (pSrcPalette) {
1722 m_pBitmap->CopyPalette(pSrcPalette); 1721 m_pBitmap->CopyPalette(pSrcPalette);
1723 } 1722 }
1724 return TRUE; 1723 return TRUE;
1725 } 1724 }
OLDNEW
« no previous file with comments | « core/src/fxcrt/xml_int.h ('k') | core/src/fxge/ge/fx_ge_device.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698