| 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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 } | 691 } |
| 692 void CPDF_DIBSource::LoadJpxBitmap() { | 692 void CPDF_DIBSource::LoadJpxBitmap() { |
| 693 ICodec_JpxModule* pJpxModule = CPDF_ModuleMgr::Get()->GetJpxModule(); | 693 ICodec_JpxModule* pJpxModule = CPDF_ModuleMgr::Get()->GetJpxModule(); |
| 694 if (!pJpxModule) | 694 if (!pJpxModule) |
| 695 return; | 695 return; |
| 696 | 696 |
| 697 nonstd::unique_ptr<JpxBitMapContext> context( | 697 nonstd::unique_ptr<JpxBitMapContext> context( |
| 698 new JpxBitMapContext(pJpxModule)); | 698 new JpxBitMapContext(pJpxModule)); |
| 699 context->set_context(pJpxModule->CreateDecoder(m_pStreamAcc->GetData(), | 699 context->set_context(pJpxModule->CreateDecoder(m_pStreamAcc->GetData(), |
| 700 m_pStreamAcc->GetSize(), | 700 m_pStreamAcc->GetSize(), |
| 701 m_pColorSpace != nullptr)); | 701 m_pColorSpace == nullptr)); |
| 702 if (!context->context()) | 702 if (!context->context()) |
| 703 return; | 703 return; |
| 704 | 704 |
| 705 FX_DWORD width = 0; | 705 FX_DWORD width = 0; |
| 706 FX_DWORD height = 0; | 706 FX_DWORD height = 0; |
| 707 FX_DWORD codestream_nComps = 0; | 707 FX_DWORD codestream_nComps = 0; |
| 708 FX_DWORD image_nComps = 0; | 708 FX_DWORD image_nComps = 0; |
| 709 pJpxModule->GetImageInfo(context->context(), width, height, codestream_nComps, | 709 pJpxModule->GetImageInfo(context->context(), width, height, codestream_nComps, |
| 710 image_nComps); | 710 image_nComps); |
| 711 if ((int)width < m_Width || (int)height < m_Height) | 711 if ((int)width < m_Width || (int)height < m_Height) |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1642 } | 1642 } |
| 1643 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { | 1643 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { |
| 1644 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); | 1644 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); |
| 1645 } | 1645 } |
| 1646 CPDF_ImageLoader::~CPDF_ImageLoader() { | 1646 CPDF_ImageLoader::~CPDF_ImageLoader() { |
| 1647 if (!m_bCached) { | 1647 if (!m_bCached) { |
| 1648 delete m_pBitmap; | 1648 delete m_pBitmap; |
| 1649 delete m_pMask; | 1649 delete m_pMask; |
| 1650 } | 1650 } |
| 1651 } | 1651 } |
| OLD | NEW |