Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Side by Side Diff: core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

Issue 1540993004: Revert "Cleanup: Remove unused CFX_PSRenderer and various encoders it used." (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "render_int.h" 7 #include "render_int.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 FX_DWORD src_size = m_pStreamAcc->GetSize(); 608 FX_DWORD src_size = m_pStreamAcc->GetSize();
609 const CPDF_Dictionary* pParams = m_pStreamAcc->GetImageParam(); 609 const CPDF_Dictionary* pParams = m_pStreamAcc->GetImageParam();
610 if (decoder == "CCITTFaxDecode") { 610 if (decoder == "CCITTFaxDecode") {
611 m_pDecoder = FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width, m_Height, 611 m_pDecoder = FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width, m_Height,
612 pParams); 612 pParams);
613 } else if (decoder == "DCTDecode") { 613 } else if (decoder == "DCTDecode") {
614 m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder( 614 m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
615 src_data, src_size, m_Width, m_Height, m_nComponents, 615 src_data, src_size, m_Width, m_Height, m_nComponents,
616 pParams ? pParams->GetInteger("ColorTransform", 1) : 1); 616 pParams ? pParams->GetInteger("ColorTransform", 1) : 1);
617 if (!m_pDecoder) { 617 if (!m_pDecoder) {
618 bool bTransform = false; 618 FX_BOOL bTransform = FALSE;
619 int comps, bpc; 619 int comps, bpc;
620 ICodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule(); 620 ICodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule();
621 if (pJpegModule->LoadInfo(src_data, src_size, &m_Width, &m_Height, &comps, 621 if (pJpegModule->LoadInfo(src_data, src_size, m_Width, m_Height, comps,
622 &bpc, &bTransform)) { 622 bpc, bTransform)) {
623 if (m_nComponents != comps) { 623 if (m_nComponents != comps) {
624 FX_Free(m_pCompData); 624 FX_Free(m_pCompData);
625 m_nComponents = comps; 625 m_nComponents = comps;
626 if (m_Family == PDFCS_LAB && m_nComponents != 3) { 626 if (m_Family == PDFCS_LAB && m_nComponents != 3) {
627 m_pCompData = NULL; 627 m_pCompData = NULL;
628 return 0; 628 return 0;
629 } 629 }
630 m_pCompData = GetDecodeAndMaskArray(m_bDefaultDecode, m_bColorKey); 630 m_pCompData = GetDecodeAndMaskArray(m_bDefaultDecode, m_bColorKey);
631 if (!m_pCompData) { 631 if (!m_pCompData) {
632 return 0; 632 return 0;
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 FX_BOOL CPDF_ImageLoader::Continue(CPDF_ImageLoaderHandle* LoadHandle, 1622 FX_BOOL CPDF_ImageLoader::Continue(CPDF_ImageLoaderHandle* LoadHandle,
1623 IFX_Pause* pPause) { 1623 IFX_Pause* pPause) {
1624 return LoadHandle->Continue(pPause); 1624 return LoadHandle->Continue(pPause);
1625 } 1625 }
1626 CPDF_ImageLoader::~CPDF_ImageLoader() { 1626 CPDF_ImageLoader::~CPDF_ImageLoader() {
1627 if (!m_bCached) { 1627 if (!m_bCached) {
1628 delete m_pBitmap; 1628 delete m_pBitmap;
1629 delete m_pMask; 1629 delete m_pMask;
1630 } 1630 }
1631 } 1631 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp ('k') | core/src/fxcodec/codec/codec_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698