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

Side by Side Diff: core/fxcodec/codec/fx_codec_progress.cpp

Issue 2053573003: Clean up fx_codec_tiff.cpp. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: remove dead code, stop passing by non-const ref Created 4 years, 6 months 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 "core/fxcodec/codec/include/ccodec_progressivedecoder.h" 7 #include "core/fxcodec/codec/include/ccodec_progressivedecoder.h"
8 8
9 #include "core/fxcodec/include/fx_codec.h" 9 #include "core/fxcodec/include/fx_codec.h"
10 #include "core/fxge/include/fx_dib.h" 10 #include "core/fxge/include/fx_dib.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 m_pTiffContext = nullptr; 246 m_pTiffContext = nullptr;
247 m_pCodecMgr = nullptr; 247 m_pCodecMgr = nullptr;
248 m_pSrcBuf = nullptr; 248 m_pSrcBuf = nullptr;
249 m_pDecodeBuf = nullptr; 249 m_pDecodeBuf = nullptr;
250 m_pDeviceBitmap = nullptr; 250 m_pDeviceBitmap = nullptr;
251 m_pSrcPalette = nullptr; 251 m_pSrcPalette = nullptr;
252 m_pCodecMgr = pCodecMgr; 252 m_pCodecMgr = pCodecMgr;
253 m_offSet = 0; 253 m_offSet = 0;
254 m_SrcSize = 0; 254 m_SrcSize = 0;
255 m_ScanlineSize = 0; 255 m_ScanlineSize = 0;
256 m_SrcWidth = m_SrcHeight = 0; 256 m_SrcWidth = 0;
257 m_SrcHeight = 0;
257 m_SrcComponents = 0; 258 m_SrcComponents = 0;
258 m_SrcBPC = 0; 259 m_SrcBPC = 0;
259 m_SrcPassNumber = 0; 260 m_SrcPassNumber = 0;
260 m_clipBox = FX_RECT(0, 0, 0, 0); 261 m_clipBox = FX_RECT(0, 0, 0, 0);
261 m_imagType = FXCODEC_IMAGE_UNKNOWN; 262 m_imagType = FXCODEC_IMAGE_UNKNOWN;
262 m_status = FXCODEC_STATUS_DECODE_FINISH; 263 m_status = FXCODEC_STATUS_DECODE_FINISH;
263 m_TransMethod = -1; 264 m_TransMethod = -1;
264 m_SrcRow = 0; 265 m_SrcRow = 0;
265 m_SrcFormat = FXCodec_Invalid; 266 m_SrcFormat = FXCodec_Invalid;
266 m_bInterpol = TRUE; 267 m_bInterpol = TRUE;
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 CCodec_TiffModule* pTiffModule = m_pCodecMgr->GetTiffModule(); 1225 CCodec_TiffModule* pTiffModule = m_pCodecMgr->GetTiffModule();
1225 if (!pTiffModule) { 1226 if (!pTiffModule) {
1226 m_status = FXCODEC_STATUS_ERR_FORMAT; 1227 m_status = FXCODEC_STATUS_ERR_FORMAT;
1227 return FALSE; 1228 return FALSE;
1228 } 1229 }
1229 m_pTiffContext = pTiffModule->CreateDecoder(m_pFile); 1230 m_pTiffContext = pTiffModule->CreateDecoder(m_pFile);
1230 if (!m_pTiffContext) { 1231 if (!m_pTiffContext) {
1231 m_status = FXCODEC_STATUS_ERR_FORMAT; 1232 m_status = FXCODEC_STATUS_ERR_FORMAT;
1232 return FALSE; 1233 return FALSE;
1233 } 1234 }
1234 int32_t frames = 0; 1235 int32_t dummy_bpc;
1235 pTiffModule->GetFrames(m_pTiffContext, frames); 1236 FX_BOOL ret = pTiffModule->LoadFrameInfo(m_pTiffContext, 0, &m_SrcWidth,
1236 uint32_t bpc; 1237 &m_SrcHeight, &m_SrcComponents,
1237 FX_BOOL ret = pTiffModule->LoadFrameInfo( 1238 &dummy_bpc, pAttribute);
1238 m_pTiffContext, 0, (uint32_t&)m_SrcWidth, (uint32_t&)m_SrcHeight,
1239 (uint32_t&)m_SrcComponents, bpc, pAttribute);
1240 m_SrcComponents = 4; 1239 m_SrcComponents = 4;
1241 m_clipBox = FX_RECT(0, 0, m_SrcWidth, m_SrcHeight); 1240 m_clipBox = FX_RECT(0, 0, m_SrcWidth, m_SrcHeight);
1242 if (!ret) { 1241 if (!ret) {
1243 pTiffModule->DestroyDecoder(m_pTiffContext); 1242 pTiffModule->DestroyDecoder(m_pTiffContext);
1244 (m_pTiffContext = nullptr); 1243 (m_pTiffContext = nullptr);
1245 (m_status = FXCODEC_STATUS_ERR_FORMAT); 1244 (m_status = FXCODEC_STATUS_ERR_FORMAT);
1246 return FALSE; 1245 return FALSE;
1247 } 1246 }
1248 } break; 1247 } break;
1249 default: 1248 default:
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
2294 } 2293 }
2295 } break; 2294 } break;
2296 default: 2295 default:
2297 break; 2296 break;
2298 } 2297 }
2299 return FXCODEC_STATUS_ERROR; 2298 return FXCODEC_STATUS_ERROR;
2300 } 2299 }
2301 CCodec_ProgressiveDecoder* CCodec_ModuleMgr::CreateProgressiveDecoder() { 2300 CCodec_ProgressiveDecoder* CCodec_ModuleMgr::CreateProgressiveDecoder() {
2302 return new CCodec_ProgressiveDecoder(this); 2301 return new CCodec_ProgressiveDecoder(this);
2303 } 2302 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698