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

Side by Side Diff: core/fpdfapi/fpdf_page/cpdf_shadingpattern.cpp

Issue 1841643002: Code change to avoid signed/unsigned mismatch warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 8 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/fpdfapi/fpdf_page/cpdf_colorstate.cpp ('k') | core/fpdfapi/fpdf_page/fpdf_page_func.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 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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/fpdfapi/fpdf_page/cpdf_shadingpattern.h" 7 #include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h"
8 8
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
(...skipping 25 matching lines...) Expand all
36 m_pCS(nullptr), 36 m_pCS(nullptr),
37 m_pCountedCS(nullptr), 37 m_pCountedCS(nullptr),
38 m_nFuncs(0) { 38 m_nFuncs(0) {
39 if (!bShading) { 39 if (!bShading) {
40 CPDF_Dictionary* pDict = m_pPatternObj->GetDict(); 40 CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
41 m_Pattern2Form = pDict->GetMatrixBy("Matrix"); 41 m_Pattern2Form = pDict->GetMatrixBy("Matrix");
42 m_pShadingObj = pDict->GetDirectObjectBy("Shading"); 42 m_pShadingObj = pDict->GetDirectObjectBy("Shading");
43 if (parentMatrix) 43 if (parentMatrix)
44 m_Pattern2Form.Concat(*parentMatrix); 44 m_Pattern2Form.Concat(*parentMatrix);
45 } 45 }
46 for (int i = 0; i < FX_ArraySize(m_pFunctions); ++i) 46 for (size_t i = 0; i < FX_ArraySize(m_pFunctions); ++i)
47 m_pFunctions[i] = nullptr; 47 m_pFunctions[i] = nullptr;
48 } 48 }
49 49
50 CPDF_ShadingPattern::~CPDF_ShadingPattern() { 50 CPDF_ShadingPattern::~CPDF_ShadingPattern() {
51 for (int i = 0; i < m_nFuncs; ++i) 51 for (int i = 0; i < m_nFuncs; ++i)
52 delete m_pFunctions[i]; 52 delete m_pFunctions[i];
53 53
54 CPDF_ColorSpace* pCS = m_pCountedCS ? m_pCountedCS->get() : nullptr; 54 CPDF_ColorSpace* pCS = m_pCountedCS ? m_pCountedCS->get() : nullptr;
55 if (pCS && m_pDocument) 55 if (pCS && m_pDocument)
56 m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray()); 56 m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 m_pCountedCS = pDocPageData->FindColorSpacePtr(m_pCS->GetArray()); 92 m_pCountedCS = pDocPageData->FindColorSpacePtr(m_pCS->GetArray());
93 93
94 m_ShadingType = ToShadingType(pShadingDict->GetIntegerBy("ShadingType")); 94 m_ShadingType = ToShadingType(pShadingDict->GetIntegerBy("ShadingType"));
95 95
96 // We expect to have a stream if our shading type is a mesh. 96 // We expect to have a stream if our shading type is a mesh.
97 if (IsMeshShading() && !ToStream(m_pShadingObj)) 97 if (IsMeshShading() && !ToStream(m_pShadingObj))
98 return FALSE; 98 return FALSE;
99 99
100 return TRUE; 100 return TRUE;
101 } 101 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_colorstate.cpp ('k') | core/fpdfapi/fpdf_page/fpdf_page_func.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698