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 "../../../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../../../third_party/base/nonstd_unique_ptr.h" |
8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
9 #include "../../../include/fpdfapi/fpdf_pageobj.h" | 9 #include "../../../include/fpdfapi/fpdf_pageobj.h" |
10 #include "../../../include/fpdfapi/fpdf_render.h" | 10 #include "../../../include/fpdfapi/fpdf_render.h" |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 } | 693 } |
694 void CPDF_DIBSource::LoadJpxBitmap() { | 694 void CPDF_DIBSource::LoadJpxBitmap() { |
695 ICodec_JpxModule* pJpxModule = CPDF_ModuleMgr::Get()->GetJpxModule(); | 695 ICodec_JpxModule* pJpxModule = CPDF_ModuleMgr::Get()->GetJpxModule(); |
696 if (!pJpxModule) | 696 if (!pJpxModule) |
697 return; | 697 return; |
698 | 698 |
699 nonstd::unique_ptr<JpxBitMapContext> context( | 699 nonstd::unique_ptr<JpxBitMapContext> context( |
700 new JpxBitMapContext(pJpxModule)); | 700 new JpxBitMapContext(pJpxModule)); |
701 context->set_decoder(pJpxModule->CreateDecoder(m_pStreamAcc->GetData(), | 701 context->set_decoder(pJpxModule->CreateDecoder(m_pStreamAcc->GetData(), |
702 m_pStreamAcc->GetSize(), | 702 m_pStreamAcc->GetSize(), |
703 m_pColorSpace != nullptr)); | 703 m_pColorSpace == nullptr)); |
704 if (!context->decoder()) | 704 if (!context->decoder()) |
705 return; | 705 return; |
706 | 706 |
707 FX_DWORD width = 0; | 707 FX_DWORD width = 0; |
708 FX_DWORD height = 0; | 708 FX_DWORD height = 0; |
709 FX_DWORD components = 0; | 709 FX_DWORD components = 0; |
710 pJpxModule->GetImageInfo(context->decoder(), &width, &height, &components); | 710 pJpxModule->GetImageInfo(context->decoder(), &width, &height, &components); |
711 if ((int)width < m_Width || (int)height < m_Height) | 711 if ((int)width < m_Width || (int)height < m_Height) |
712 return; | 712 return; |
713 | 713 |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 } | 1663 } |
1664 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { | 1664 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { |
1665 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); | 1665 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); |
1666 } | 1666 } |
1667 CPDF_ImageLoader::~CPDF_ImageLoader() { | 1667 CPDF_ImageLoader::~CPDF_ImageLoader() { |
1668 if (!m_bCached) { | 1668 if (!m_bCached) { |
1669 delete m_pBitmap; | 1669 delete m_pBitmap; |
1670 delete m_pMask; | 1670 delete m_pMask; |
1671 } | 1671 } |
1672 } | 1672 } |
OLD | NEW |