| OLD | NEW |
| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 CPDF_CountedPattern* ptData = nullptr; | 344 CPDF_CountedPattern* ptData = nullptr; |
| 345 auto it = m_PatternMap.find(pPatternObj); | 345 auto it = m_PatternMap.find(pPatternObj); |
| 346 if (it != m_PatternMap.end()) { | 346 if (it != m_PatternMap.end()) { |
| 347 ptData = it->second; | 347 ptData = it->second; |
| 348 if (ptData->get()) { | 348 if (ptData->get()) { |
| 349 return ptData->AddRef(); | 349 return ptData->AddRef(); |
| 350 } | 350 } |
| 351 } | 351 } |
| 352 CPDF_Pattern* pPattern = nullptr; | 352 CPDF_Pattern* pPattern = nullptr; |
| 353 if (bShading) { | 353 if (bShading) { |
| 354 pPattern = | 354 pPattern = new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, TRUE, matrix); |
| 355 new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, bShading, matrix); | |
| 356 } else { | 355 } else { |
| 357 CPDF_Dictionary* pDict = pPatternObj ? pPatternObj->GetDict() : nullptr; | 356 CPDF_Dictionary* pDict = pPatternObj ? pPatternObj->GetDict() : nullptr; |
| 358 if (pDict) { | 357 if (pDict) { |
| 359 int type = pDict->GetIntegerBy("PatternType"); | 358 int type = pDict->GetIntegerBy("PatternType"); |
| 360 if (type == CPDF_Pattern::TILING) { | 359 if (type == CPDF_Pattern::TILING) { |
| 361 pPattern = new CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix); | 360 pPattern = new CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix); |
| 362 } else if (type == CPDF_Pattern::SHADING) { | 361 } else if (type == CPDF_Pattern::SHADING) { |
| 363 pPattern = | 362 pPattern = |
| 364 new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FALSE, matrix); | 363 new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FALSE, matrix); |
| 365 } | 364 } |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 } | 531 } |
| 533 | 532 |
| 534 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( | 533 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( |
| 535 CPDF_Object* pPatternObj) const { | 534 CPDF_Object* pPatternObj) const { |
| 536 if (!pPatternObj) | 535 if (!pPatternObj) |
| 537 return nullptr; | 536 return nullptr; |
| 538 | 537 |
| 539 auto it = m_PatternMap.find(pPatternObj); | 538 auto it = m_PatternMap.find(pPatternObj); |
| 540 return it != m_PatternMap.end() ? it->second : nullptr; | 539 return it != m_PatternMap.end() ? it->second : nullptr; |
| 541 } | 540 } |
| OLD | NEW |