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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
330 } | 330 } |
331 CPDF_Pattern* pPattern = nullptr; | 331 CPDF_Pattern* pPattern = nullptr; |
332 if (bShading) { | 332 if (bShading) { |
333 pPattern = | 333 pPattern = new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, TRUE, matrix); |
334 new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, bShading, matrix); | |
335 } else { | 334 } else { |
336 CPDF_Dictionary* pDict = pPatternObj ? pPatternObj->GetDict() : nullptr; | 335 CPDF_Dictionary* pDict = pPatternObj ? pPatternObj->GetDict() : nullptr; |
337 if (pDict) { | 336 if (pDict) { |
338 int type = pDict->GetIntegerBy("PatternType"); | 337 int type = pDict->GetIntegerBy("PatternType"); |
339 if (type == CPDF_Pattern::TILING) { | 338 if (type == CPDF_Pattern::TILING) { |
340 pPattern = new CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix); | 339 pPattern = new CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix); |
341 } else if (type == CPDF_Pattern::SHADING) { | 340 } else if (type == CPDF_Pattern::SHADING) { |
342 pPattern = | 341 pPattern = |
343 new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FALSE, matrix); | 342 new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FALSE, matrix); |
344 } | 343 } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 } | 510 } |
512 | 511 |
513 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( | 512 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( |
514 CPDF_Object* pPatternObj) const { | 513 CPDF_Object* pPatternObj) const { |
515 if (!pPatternObj) | 514 if (!pPatternObj) |
516 return nullptr; | 515 return nullptr; |
517 | 516 |
518 auto it = m_PatternMap.find(pPatternObj); | 517 auto it = m_PatternMap.find(pPatternObj); |
519 return it != m_PatternMap.end() ? it->second : nullptr; | 518 return it != m_PatternMap.end() ? it->second : nullptr; |
520 } | 519 } |
OLD | NEW |