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

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page_doc.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/include/fpdfapi/fpdf_resource.h ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_pattern.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/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../../../include/fdrm/fx_crypt.h" 9 #include "../../../include/fdrm/fx_crypt.h"
10 #include "../fpdf_font/font_int.h" 10 #include "../fpdf_font/font_int.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 m_FontFileMap.RemoveKey(ftKey); 222 m_FontFileMap.RemoveKey(ftKey);
223 } 223 }
224 } 224 }
225 pos = m_PatternMap.GetStartPosition(); 225 pos = m_PatternMap.GetStartPosition();
226 while (pos) { 226 while (pos) {
227 CPDF_Object* ptObj; 227 CPDF_Object* ptObj;
228 CPDF_CountedObject<CPDF_Pattern*>* ptData; 228 CPDF_CountedObject<CPDF_Pattern*>* ptData;
229 m_PatternMap.GetNextAssoc(pos, ptObj, ptData); 229 m_PatternMap.GetNextAssoc(pos, ptObj, ptData);
230 nCount = ptData->m_nCount; 230 nCount = ptData->m_nCount;
231 if (bForceRelease || nCount < 2) { 231 if (bForceRelease || nCount < 2) {
232 ptData->m_Obj->SetForceClear(bForceRelease);
232 delete ptData->m_Obj; 233 delete ptData->m_Obj;
233 ptData->m_Obj = NULL; 234 ptData->m_Obj = NULL;
234 } 235 }
235 } 236 }
236 } 237 }
237 CPDF_Font* CPDF_DocPageData::GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnl y) 238 CPDF_Font* CPDF_DocPageData::GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnl y)
238 { 239 {
239 if (!pFontDict) { 240 if (!pFontDict) {
240 return NULL; 241 return NULL;
241 } 242 }
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 m_FontFileMap.SetAt(pFontStream, ftData); 629 m_FontFileMap.SetAt(pFontStream, ftData);
629 return pFontFile; 630 return pFontFile;
630 } 631 }
631 void CPDF_DocPageData::ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, FX_BOO L bForce) 632 void CPDF_DocPageData::ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, FX_BOO L bForce)
632 { 633 {
633 if (!pFontStream) { 634 if (!pFontStream) {
634 return; 635 return;
635 } 636 }
636 PDF_DocPageData_Release<CPDF_Stream*, CPDF_StreamAcc*>(m_FontFileMap, pFontS tream, NULL, bForce); 637 PDF_DocPageData_Release<CPDF_Stream*, CPDF_StreamAcc*>(m_FontFileMap, pFontS tream, NULL, bForce);
637 } 638 }
OLDNEW
« no previous file with comments | « core/include/fpdfapi/fpdf_resource.h ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698