| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/fpdfapi/render/cpdf_imagerenderer.h" | 7 #include "core/fpdfapi/render/cpdf_imagerenderer.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 m_pClone->ConvertColorScale(m_pRenderStatus->m_Options.m_BackColor, | 116 m_pClone->ConvertColorScale(m_pRenderStatus->m_Options.m_BackColor, |
| 117 m_pRenderStatus->m_Options.m_ForeColor); | 117 m_pRenderStatus->m_Options.m_ForeColor); |
| 118 m_pDIBSource = m_pClone.get(); | 118 m_pDIBSource = m_pClone.get(); |
| 119 } | 119 } |
| 120 m_Flags = 0; | 120 m_Flags = 0; |
| 121 if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_DOWNSAMPLE) | 121 if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_DOWNSAMPLE) |
| 122 m_Flags |= RENDER_FORCE_DOWNSAMPLE; | 122 m_Flags |= RENDER_FORCE_DOWNSAMPLE; |
| 123 else if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_HALFTONE) | 123 else if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_HALFTONE) |
| 124 m_Flags |= RENDER_FORCE_HALFTONE; | 124 m_Flags |= RENDER_FORCE_HALFTONE; |
| 125 if (m_pRenderStatus->m_pDevice->GetDeviceClass() != FXDC_DISPLAY) { | 125 if (m_pRenderStatus->m_pDevice->GetDeviceClass() != FXDC_DISPLAY) { |
| 126 if (m_pRenderStatus->m_Options.m_Flags & RENDER_COMPRESS_IMAGES) |
| 127 m_Flags |= FXRENDER_IMAGE_LOSSY; |
| 126 CPDF_Object* pFilters = | 128 CPDF_Object* pFilters = |
| 127 m_pImageObject->GetImage()->GetStream()->GetDict()->GetDirectObjectFor( | 129 m_pImageObject->GetImage()->GetStream()->GetDict()->GetDirectObjectFor( |
| 128 "Filter"); | 130 "Filter"); |
| 129 if (pFilters) { | 131 if (pFilters) { |
| 130 if (pFilters->IsName()) { | 132 if (pFilters->IsName()) { |
| 131 CFX_ByteString bsDecodeType = pFilters->GetString(); | 133 CFX_ByteString bsDecodeType = pFilters->GetString(); |
| 132 if (bsDecodeType == "DCTDecode" || bsDecodeType == "JPXDecode") | 134 if (bsDecodeType == "DCTDecode" || bsDecodeType == "JPXDecode") |
| 133 m_Flags |= FXRENDER_IMAGE_LOSSY; | 135 m_Flags |= FXRENDER_IMAGE_LOSSY; |
| 134 } else if (CPDF_Array* pArray = pFilters->AsArray()) { | 136 } else if (CPDF_Array* pArray = pFilters->AsArray()) { |
| 135 for (size_t i = 0; i < pArray->GetCount(); i++) { | 137 for (size_t i = 0; i < pArray->GetCount(); i++) { |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 | 565 |
| 564 if (m_Status == 4) { | 566 if (m_Status == 4) { |
| 565 if (m_Loader.Continue(pPause)) | 567 if (m_Loader.Continue(pPause)) |
| 566 return true; | 568 return true; |
| 567 | 569 |
| 568 if (StartRenderDIBSource()) | 570 if (StartRenderDIBSource()) |
| 569 return Continue(pPause); | 571 return Continue(pPause); |
| 570 } | 572 } |
| 571 return false; | 573 return false; |
| 572 } | 574 } |
| OLD | NEW |