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/fxge/fx_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
8 #include "../../../include/fxcodec/fx_codec.h" | 8 #include "../../../include/fxcodec/fx_codec.h" |
9 #include "../../../include/fpdfapi/fpdf_module.h" | 9 #include "../../../include/fpdfapi/fpdf_module.h" |
10 #include "../../../include/fpdfapi/fpdf_render.h" | 10 #include "../../../include/fpdfapi/fpdf_render.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 FX_SAFE_DWORD src_pitch = | 322 FX_SAFE_DWORD src_pitch = |
323 CalculatePitch8(m_bpc, m_nComponents, m_Width, m_Height); | 323 CalculatePitch8(m_bpc, m_nComponents, m_Width, m_Height); |
324 if (!src_pitch.IsValid()) { | 324 if (!src_pitch.IsValid()) { |
325 return 0; | 325 return 0; |
326 } | 326 } |
327 m_pStreamAcc = FX_NEW CPDF_StreamAcc; | 327 m_pStreamAcc = FX_NEW CPDF_StreamAcc; |
328 m_pStreamAcc->LoadAllData(pStream, FALSE, src_pitch.ValueOrDie(), TRUE); | 328 m_pStreamAcc->LoadAllData(pStream, FALSE, src_pitch.ValueOrDie(), TRUE); |
329 if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) { | 329 if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) { |
330 return 0; | 330 return 0; |
331 } | 331 } |
332 const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder(); | |
333 int ret = CreateDecoder(); | 332 int ret = CreateDecoder(); |
334 if (ret != 1) { | 333 if (ret != 1) { |
335 if (!ret) { | 334 if (!ret) { |
336 return ret; | 335 return ret; |
337 } | 336 } |
338 if (!ContinueToLoadMask()) { | 337 if (!ContinueToLoadMask()) { |
339 return 0; | 338 return 0; |
340 } | 339 } |
341 if (m_bHasMask) { | 340 if (m_bHasMask) { |
342 StratLoadMask(); | 341 StratLoadMask(); |
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 { | 1509 { |
1511 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); | 1510 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); |
1512 } | 1511 } |
1513 CPDF_ImageLoader::~CPDF_ImageLoader() | 1512 CPDF_ImageLoader::~CPDF_ImageLoader() |
1514 { | 1513 { |
1515 if (!m_bCached) { | 1514 if (!m_bCached) { |
1516 delete m_pBitmap; | 1515 delete m_pBitmap; |
1517 delete m_pMask; | 1516 delete m_pMask; |
1518 } | 1517 } |
1519 } | 1518 } |
OLD | NEW |