| 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 "pageint.h" | 7 #include "pageint.h" |
| 8 | 8 |
| 9 #include "core/include/fdrm/fx_crypt.h" | 9 #include "core/include/fdrm/fx_crypt.h" |
| 10 #include "core/include/fpdfapi/fpdf_module.h" | 10 #include "core/include/fpdfapi/fpdf_module.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 return GetValidatePageData()->GetFontFileStreamAcc(pStream); | 84 return GetValidatePageData()->GetFontFileStreamAcc(pStream); |
| 85 } | 85 } |
| 86 | 86 |
| 87 CPDF_ColorSpace* _CSFromName(const CFX_ByteString& name); | 87 CPDF_ColorSpace* _CSFromName(const CFX_ByteString& name); |
| 88 CPDF_ColorSpace* CPDF_Document::LoadColorSpace(CPDF_Object* pCSObj, | 88 CPDF_ColorSpace* CPDF_Document::LoadColorSpace(CPDF_Object* pCSObj, |
| 89 CPDF_Dictionary* pResources) { | 89 CPDF_Dictionary* pResources) { |
| 90 return GetValidatePageData()->GetColorSpace(pCSObj, pResources); | 90 return GetValidatePageData()->GetColorSpace(pCSObj, pResources); |
| 91 } | 91 } |
| 92 CPDF_Pattern* CPDF_Document::LoadPattern(CPDF_Object* pPatternObj, | 92 CPDF_Pattern* CPDF_Document::LoadPattern(CPDF_Object* pPatternObj, |
| 93 FX_BOOL bShading, | 93 FX_BOOL bShading, |
| 94 const CFX_AffineMatrix* matrix) { | 94 const CFX_Matrix* matrix) { |
| 95 return GetValidatePageData()->GetPattern(pPatternObj, bShading, matrix); | 95 return GetValidatePageData()->GetPattern(pPatternObj, bShading, matrix); |
| 96 } | 96 } |
| 97 CPDF_IccProfile* CPDF_Document::LoadIccProfile(CPDF_Stream* pStream) { | 97 CPDF_IccProfile* CPDF_Document::LoadIccProfile(CPDF_Stream* pStream) { |
| 98 return GetValidatePageData()->GetIccProfile(pStream); | 98 return GetValidatePageData()->GetIccProfile(pStream); |
| 99 } | 99 } |
| 100 CPDF_Image* CPDF_Document::LoadImageF(CPDF_Object* pObj) { | 100 CPDF_Image* CPDF_Document::LoadImageF(CPDF_Object* pObj) { |
| 101 if (!pObj) { | 101 if (!pObj) { |
| 102 return NULL; | 102 return NULL; |
| 103 } | 103 } |
| 104 FXSYS_assert(pObj->GetObjNum()); | 104 FXSYS_assert(pObj->GetObjNum()); |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 csData->RemoveRef(); | 397 csData->RemoveRef(); |
| 398 if (csData->use_count() == 0) { | 398 if (csData->use_count() == 0) { |
| 399 csData->get()->ReleaseCS(); | 399 csData->get()->ReleaseCS(); |
| 400 csData->reset(nullptr); | 400 csData->reset(nullptr); |
| 401 } | 401 } |
| 402 } | 402 } |
| 403 } | 403 } |
| 404 | 404 |
| 405 CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj, | 405 CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj, |
| 406 FX_BOOL bShading, | 406 FX_BOOL bShading, |
| 407 const CFX_AffineMatrix* matrix) { | 407 const CFX_Matrix* matrix) { |
| 408 if (!pPatternObj) | 408 if (!pPatternObj) |
| 409 return nullptr; | 409 return nullptr; |
| 410 | 410 |
| 411 CPDF_CountedPattern* ptData = nullptr; | 411 CPDF_CountedPattern* ptData = nullptr; |
| 412 auto it = m_PatternMap.find(pPatternObj); | 412 auto it = m_PatternMap.find(pPatternObj); |
| 413 if (it != m_PatternMap.end()) { | 413 if (it != m_PatternMap.end()) { |
| 414 ptData = it->second; | 414 ptData = it->second; |
| 415 if (ptData->get()) { | 415 if (ptData->get()) { |
| 416 return ptData->AddRef(); | 416 return ptData->AddRef(); |
| 417 } | 417 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 } | 598 } |
| 599 | 599 |
| 600 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( | 600 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( |
| 601 CPDF_Object* pPatternObj) const { | 601 CPDF_Object* pPatternObj) const { |
| 602 if (!pPatternObj) | 602 if (!pPatternObj) |
| 603 return nullptr; | 603 return nullptr; |
| 604 | 604 |
| 605 auto it = m_PatternMap.find(pPatternObj); | 605 auto it = m_PatternMap.find(pPatternObj); |
| 606 return it != m_PatternMap.end() ? it->second : nullptr; | 606 return it != m_PatternMap.end() ? it->second : nullptr; |
| 607 } | 607 } |
| OLD | NEW |