| 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 "render_int.h" | 7 #include "render_int.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 } | 677 } |
| 678 return 1; | 678 return 1; |
| 679 } | 679 } |
| 680 void CPDF_DIBSource::LoadJpxBitmap() { | 680 void CPDF_DIBSource::LoadJpxBitmap() { |
| 681 ICodec_JpxModule* pJpxModule = CPDF_ModuleMgr::Get()->GetJpxModule(); | 681 ICodec_JpxModule* pJpxModule = CPDF_ModuleMgr::Get()->GetJpxModule(); |
| 682 if (!pJpxModule) | 682 if (!pJpxModule) |
| 683 return; | 683 return; |
| 684 | 684 |
| 685 nonstd::unique_ptr<JpxBitMapContext> context( | 685 nonstd::unique_ptr<JpxBitMapContext> context( |
| 686 new JpxBitMapContext(pJpxModule)); | 686 new JpxBitMapContext(pJpxModule)); |
| 687 context->set_decoder(pJpxModule->CreateDecoder(m_pStreamAcc->GetData(), | 687 context->set_decoder(pJpxModule->CreateDecoder( |
| 688 m_pStreamAcc->GetSize(), | 688 m_pStreamAcc->GetData(), m_pStreamAcc->GetSize(), m_pColorSpace)); |
| 689 m_pColorSpace == nullptr)); | |
| 690 if (!context->decoder()) | 689 if (!context->decoder()) |
| 691 return; | 690 return; |
| 692 | 691 |
| 693 FX_DWORD width = 0; | 692 FX_DWORD width = 0; |
| 694 FX_DWORD height = 0; | 693 FX_DWORD height = 0; |
| 695 FX_DWORD components = 0; | 694 FX_DWORD components = 0; |
| 696 pJpxModule->GetImageInfo(context->decoder(), &width, &height, &components); | 695 pJpxModule->GetImageInfo(context->decoder(), &width, &height, &components); |
| 697 if ((int)width < m_Width || (int)height < m_Height) | 696 if ((int)width < m_Width || (int)height < m_Height) |
| 698 return; | 697 return; |
| 699 | 698 |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1622 FX_BOOL CPDF_ImageLoader::Continue(CPDF_ImageLoaderHandle* LoadHandle, | 1621 FX_BOOL CPDF_ImageLoader::Continue(CPDF_ImageLoaderHandle* LoadHandle, |
| 1623 IFX_Pause* pPause) { | 1622 IFX_Pause* pPause) { |
| 1624 return LoadHandle->Continue(pPause); | 1623 return LoadHandle->Continue(pPause); |
| 1625 } | 1624 } |
| 1626 CPDF_ImageLoader::~CPDF_ImageLoader() { | 1625 CPDF_ImageLoader::~CPDF_ImageLoader() { |
| 1627 if (!m_bCached) { | 1626 if (!m_bCached) { |
| 1628 delete m_pBitmap; | 1627 delete m_pBitmap; |
| 1629 delete m_pMask; | 1628 delete m_pMask; |
| 1630 } | 1629 } |
| 1631 } | 1630 } |
| OLD | NEW |