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

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp

Issue 572853006: When forcing clear page data, no need to release colorspace when releasing pattern (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 3 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/fpdfapi/fpdf_page/fpdf_page_doc.cpp ('k') | no next file » | 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/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "pageint.h" 8 #include "pageint.h"
9 9
10 CPDF_Pattern::CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix) : 10 CPDF_Pattern::CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix) :
11 m_pPatternObj(NULL), m_PatternType(PATTERN_TILING), m_pDocument(NULL) 11 m_pPatternObj(NULL), m_PatternType(PATTERN_TILING), m_pDocument(NULL), m_bFo rceClear(FALSE)
12 { 12 {
13 if (pParentMatrix) { 13 if (pParentMatrix) {
14 m_ParentMatrix = *pParentMatrix; 14 m_ParentMatrix = *pParentMatrix;
15 } 15 }
16 } 16 }
17 CPDF_Pattern::~CPDF_Pattern() 17 CPDF_Pattern::~CPDF_Pattern()
18 { 18 {
19 } 19 }
20 CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc, CPDF_Object* pPatter nObj, const CFX_AffineMatrix* parentMatrix) : 20 CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc, CPDF_Object* pPatter nObj, const CFX_AffineMatrix* parentMatrix) :
21 CPDF_Pattern(parentMatrix) 21 CPDF_Pattern(parentMatrix)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 void CPDF_ShadingPattern::Clear() 91 void CPDF_ShadingPattern::Clear()
92 { 92 {
93 for (int i = 0; i < m_nFuncs; i ++) { 93 for (int i = 0; i < m_nFuncs; i ++) {
94 if (m_pFunctions[i]) { 94 if (m_pFunctions[i]) {
95 delete m_pFunctions[i]; 95 delete m_pFunctions[i];
96 } 96 }
97 m_pFunctions[i] = NULL; 97 m_pFunctions[i] = NULL;
98 } 98 }
99 CPDF_ColorSpace* pCS = m_pCS; 99 CPDF_ColorSpace* pCS = m_pCS;
100 if (pCS && m_pDocument) { 100 if (!m_bForceClear && pCS && m_pDocument) {
101 m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray()); 101 m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
102 } 102 }
103 m_ShadingType = 0; 103 m_ShadingType = 0;
104 m_pCS = NULL; 104 m_pCS = NULL;
105 m_nFuncs = 0; 105 m_nFuncs = 0;
106 } 106 }
107 FX_BOOL CPDF_ShadingPattern::Load() 107 FX_BOOL CPDF_ShadingPattern::Load()
108 { 108 {
109 if (m_ShadingType != 0) { 109 if (m_ShadingType != 0) {
110 return TRUE; 110 return TRUE;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } 281 }
282 } 282 }
283 stream.m_BitStream.SkipBits(stream.m_nComps * stream.m_nCompBits * color _count); 283 stream.m_BitStream.SkipBits(stream.m_nComps * stream.m_nCompBits * color _count);
284 if (bGouraud) { 284 if (bGouraud) {
285 stream.m_BitStream.ByteAlign(); 285 stream.m_BitStream.ByteAlign();
286 } 286 }
287 } 287 }
288 rect.Transform(pMatrix); 288 rect.Transform(pMatrix);
289 return rect; 289 return rect;
290 } 290 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698