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

Side by Side Diff: core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

Issue 1529553003: Merge to XFA: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: 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
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 "render_int.h" 7 #include "render_int.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 if (CPDF_Stream* pStream = ToStream(m_pDict->GetElementValue("Mask"))) 781 if (CPDF_Stream* pStream = ToStream(m_pDict->GetElementValue("Mask")))
782 return LoadMaskDIB(pStream); 782 return LoadMaskDIB(pStream);
783 783
784 return nullptr; 784 return nullptr;
785 } 785 }
786 int CPDF_DIBSource::StratLoadMask() { 786 int CPDF_DIBSource::StratLoadMask() {
787 m_MatteColor = 0XFFFFFFFF; 787 m_MatteColor = 0XFFFFFFFF;
788 m_pMaskStream = m_pDict->GetStream("SMask"); 788 m_pMaskStream = m_pDict->GetStream("SMask");
789 if (m_pMaskStream) { 789 if (m_pMaskStream) {
790 CPDF_Array* pMatte = m_pMaskStream->GetDict()->GetArray("Matte"); 790 CPDF_Array* pMatte = m_pMaskStream->GetDict()->GetArray("Matte");
791 if (pMatte != NULL && m_pColorSpace && 791 if (pMatte && m_pColorSpace &&
792 (FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) { 792 (FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) {
793 FX_FLOAT R, G, B; 793 FX_FLOAT R, G, B;
794 FX_FLOAT* pColor = FX_Alloc(FX_FLOAT, m_nComponents); 794 FX_FLOAT* pColor = FX_Alloc(FX_FLOAT, m_nComponents);
795 for (FX_DWORD i = 0; i < m_nComponents; i++) { 795 for (FX_DWORD i = 0; i < m_nComponents; i++) {
796 pColor[i] = pMatte->GetFloat(i); 796 pColor[i] = pMatte->GetFloat(i);
797 } 797 }
798 m_pColorSpace->GetRGB(pColor, R, G, B); 798 m_pColorSpace->GetRGB(pColor, R, G, B);
799 FX_Free(pColor); 799 FX_Free(pColor);
800 m_MatteColor = FXARGB_MAKE(0, FXSYS_round(R * 255), FXSYS_round(G * 255), 800 m_MatteColor = FXARGB_MAKE(0, FXSYS_round(R * 255), FXSYS_round(G * 255),
801 FXSYS_round(B * 255)); 801 FXSYS_round(B * 255));
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 } 1643 }
1644 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { 1644 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) {
1645 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); 1645 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause);
1646 } 1646 }
1647 CPDF_ImageLoader::~CPDF_ImageLoader() { 1647 CPDF_ImageLoader::~CPDF_ImageLoader() {
1648 if (!m_bCached) { 1648 if (!m_bCached) {
1649 delete m_pBitmap; 1649 delete m_pBitmap;
1650 delete m_pMask; 1650 delete m_pMask;
1651 } 1651 }
1652 } 1652 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698