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

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

Issue 1923153002: CPDF_Document::LoadPattern() and friends always have a valid matrix. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@clean_doc2
Patch Set: rebase Created 4 years, 7 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
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/fpdfapi/fpdf_page/pageint.h" 7 #include "core/fpdfapi/fpdf_page/pageint.h"
8 8
9 #include "core/fdrm/crypto/include/fx_crypt.h" 9 #include "core/fdrm/crypto/include/fx_crypt.h"
10 #include "core/fpdfapi/fpdf_font/cpdf_type1font.h" 10 #include "core/fpdfapi/fpdf_font/cpdf_type1font.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 csData->RemoveRef(); 309 csData->RemoveRef();
310 if (csData->use_count() == 0) { 310 if (csData->use_count() == 0) {
311 csData->get()->ReleaseCS(); 311 csData->get()->ReleaseCS();
312 csData->reset(nullptr); 312 csData->reset(nullptr);
313 } 313 }
314 } 314 }
315 } 315 }
316 316
317 CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj, 317 CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj,
318 FX_BOOL bShading, 318 FX_BOOL bShading,
319 const CFX_Matrix* matrix) { 319 const CFX_Matrix& matrix) {
320 if (!pPatternObj) 320 if (!pPatternObj)
321 return nullptr; 321 return nullptr;
322 322
323 CPDF_CountedPattern* ptData = nullptr; 323 CPDF_CountedPattern* ptData = nullptr;
324 auto it = m_PatternMap.find(pPatternObj); 324 auto it = m_PatternMap.find(pPatternObj);
325 if (it != m_PatternMap.end()) { 325 if (it != m_PatternMap.end()) {
326 ptData = it->second; 326 ptData = it->second;
327 if (ptData->get()) { 327 if (ptData->get()) {
328 return ptData->AddRef(); 328 return ptData->AddRef();
329 } 329 }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 } 510 }
511 511
512 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( 512 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr(
513 CPDF_Object* pPatternObj) const { 513 CPDF_Object* pPatternObj) const {
514 if (!pPatternObj) 514 if (!pPatternObj)
515 return nullptr; 515 return nullptr;
516 516
517 auto it = m_PatternMap.find(pPatternObj); 517 auto it = m_PatternMap.find(pPatternObj);
518 return it != m_PatternMap.end() ? it->second : nullptr; 518 return it != m_PatternMap.end() ? it->second : nullptr;
519 } 519 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_tilingpattern.cpp ('k') | core/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698