Chromium Code Reviews| 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 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 950 m_bpc = m_bpc_orig; | 950 m_bpc = m_bpc_orig; |
| 951 CPDF_Object* pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter")); | 951 CPDF_Object* pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter")); |
| 952 if (pFilter) { | 952 if (pFilter) { |
| 953 if (pFilter->GetType() == PDFOBJ_NAME) { | 953 if (pFilter->GetType() == PDFOBJ_NAME) { |
| 954 CFX_ByteString filter = pFilter->GetString(); | 954 CFX_ByteString filter = pFilter->GetString(); |
| 955 if (filter == FX_BSTRC("CCITTFaxDecode") || | 955 if (filter == FX_BSTRC("CCITTFaxDecode") || |
| 956 filter == FX_BSTRC("JBIG2Decode")) { | 956 filter == FX_BSTRC("JBIG2Decode")) { |
| 957 m_bpc = 1; | 957 m_bpc = 1; |
| 958 m_nComponents = 1; | 958 m_nComponents = 1; |
| 959 } | 959 } |
| 960 if (filter == FX_BSTRC("RunLengthDecode") || | 960 if (filter == FX_BSTRC("RunLengthDecode") && m_bpc != 1) { |
|
Tom Sepez
2015/09/08 15:47:19
nit: I might write
if (filter == FX_BSTRC("RunL
jun_fang
2015/09/09 09:57:12
Acknowledged.
| |
| 961 filter == FX_BSTRC("DCTDecode")) { | 961 m_bpc = 8; |
| 962 } | |
| 963 if (filter == FX_BSTRC("DCTDecode")) { | |
| 962 m_bpc = 8; | 964 m_bpc = 8; |
| 963 } | 965 } |
| 964 } else if (pFilter->GetType() == PDFOBJ_ARRAY) { | 966 } else if (pFilter->GetType() == PDFOBJ_ARRAY) { |
| 965 CPDF_Array* pArray = (CPDF_Array*)pFilter; | 967 CPDF_Array* pArray = (CPDF_Array*)pFilter; |
| 966 if (pArray->GetString(pArray->GetCount() - 1) == | 968 if (pArray->GetString(pArray->GetCount() - 1) == |
| 967 FX_BSTRC("CCITTFaxDecode") || | 969 FX_BSTRC("CCITTFaxDecode") || |
| 968 pArray->GetString(pArray->GetCount() - 1) == | 970 pArray->GetString(pArray->GetCount() - 1) == |
| 969 FX_BSTRC("JBIG2Decode")) { | 971 FX_BSTRC("JBIG2Decode")) { |
| 970 m_bpc = 1; | 972 m_bpc = 1; |
| 971 m_nComponents = 1; | 973 m_nComponents = 1; |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1663 } | 1665 } |
| 1664 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { | 1666 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { |
| 1665 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); | 1667 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); |
| 1666 } | 1668 } |
| 1667 CPDF_ImageLoader::~CPDF_ImageLoader() { | 1669 CPDF_ImageLoader::~CPDF_ImageLoader() { |
| 1668 if (!m_bCached) { | 1670 if (!m_bCached) { |
| 1669 delete m_pBitmap; | 1671 delete m_pBitmap; |
| 1670 delete m_pMask; | 1672 delete m_pMask; |
| 1671 } | 1673 } |
| 1672 } | 1674 } |
| OLD | NEW |