| 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 "../../../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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 if (!pImageStream) | 463 if (!pImageStream) |
| 464 return nullptr; | 464 return nullptr; |
| 465 | 465 |
| 466 const FX_DWORD dwImageObjNum = pImageStream->GetObjNum(); | 466 const FX_DWORD dwImageObjNum = pImageStream->GetObjNum(); |
| 467 auto it = m_ImageMap.find(dwImageObjNum); | 467 auto it = m_ImageMap.find(dwImageObjNum); |
| 468 if (it != m_ImageMap.end()) { | 468 if (it != m_ImageMap.end()) { |
| 469 return it->second->AddRef(); | 469 return it->second->AddRef(); |
| 470 } | 470 } |
| 471 | 471 |
| 472 CPDF_Image* pImage = new CPDF_Image(m_pPDFDoc); | 472 CPDF_Image* pImage = new CPDF_Image(m_pPDFDoc); |
| 473 pImage->LoadImageF((CPDF_Stream*)pImageStream, FALSE); | 473 pImage->LoadImageF(pImageStream->AsStream(), FALSE); |
| 474 | 474 |
| 475 CPDF_CountedImage* imageData = new CPDF_CountedImage(pImage); | 475 CPDF_CountedImage* imageData = new CPDF_CountedImage(pImage); |
| 476 m_ImageMap[dwImageObjNum] = imageData; | 476 m_ImageMap[dwImageObjNum] = imageData; |
| 477 return imageData->AddRef(); | 477 return imageData->AddRef(); |
| 478 } | 478 } |
| 479 | 479 |
| 480 void CPDF_DocPageData::ReleaseImage(CPDF_Object* pImageStream) { | 480 void CPDF_DocPageData::ReleaseImage(CPDF_Object* pImageStream) { |
| 481 if (!pImageStream || !pImageStream->GetObjNum()) | 481 if (!pImageStream || !pImageStream->GetObjNum()) |
| 482 return; | 482 return; |
| 483 | 483 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 } | 596 } |
| 597 | 597 |
| 598 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( | 598 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( |
| 599 CPDF_Object* pPatternObj) const { | 599 CPDF_Object* pPatternObj) const { |
| 600 if (!pPatternObj) | 600 if (!pPatternObj) |
| 601 return nullptr; | 601 return nullptr; |
| 602 | 602 |
| 603 auto it = m_PatternMap.find(pPatternObj); | 603 auto it = m_PatternMap.find(pPatternObj); |
| 604 return it != m_PatternMap.end() ? it->second : nullptr; | 604 return it != m_PatternMap.end() ? it->second : nullptr; |
| 605 } | 605 } |
| OLD | NEW |