summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/ccodec_progressivedecoder.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-06-01 12:29:09 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-01 20:14:44 +0000
commit5171a27eaa7489939310bd2864864867cc78ce21 (patch)
tree3c4a0cf4a4d4296ddc2c92c39850a5821f21e5cd /core/fxcodec/codec/ccodec_progressivedecoder.h
parent5f34d479d06ebab9079c2d0704dee872cc45dd86 (diff)
downloadpdfium-5171a27eaa7489939310bd2864864867cc78ce21.tar.xz
Use unique_ptrs for codec contexts in ccodec_progressivedecoder.chromium/3118
Change-Id: I4deaf8ca946c2dcb6842c5702b02eed1c22b1201 Reviewed-on: https://pdfium-review.googlesource.com/6191 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/ccodec_progressivedecoder.h')
-rw-r--r--core/fxcodec/codec/ccodec_progressivedecoder.h90
1 files changed, 44 insertions, 46 deletions
diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h
index 19101c1cbb..50c5405e9b 100644
--- a/core/fxcodec/codec/ccodec_progressivedecoder.h
+++ b/core/fxcodec/codec/ccodec_progressivedecoder.h
@@ -125,51 +125,6 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
std::vector<uint8_t> m_pWeightTables;
};
- CFX_RetainPtr<IFX_SeekableReadStream> m_pFile;
- CFX_UnownedPtr<CCodec_ModuleMgr> m_pCodecMgr;
-
- // TODO(tsepez): All these contexts probably should be unique_ptrs.
- CFX_UnownedPtr<CCodec_JpegModule::Context> m_pJpegContext;
- CFX_UnownedPtr<CCodec_PngModule::Context> m_pPngContext;
- std::unique_ptr<CCodec_GifModule::Context> m_pGifContext;
- CFX_UnownedPtr<CCodec_BmpModule::Context> m_pBmpContext;
- CFX_UnownedPtr<CCodec_TiffContext> m_pTiffContext;
- FXCODEC_IMAGE_TYPE m_imagType;
- uint32_t m_offSet;
- uint8_t* m_pSrcBuf;
- uint32_t m_SrcSize;
- uint8_t* m_pDecodeBuf;
- int m_ScanlineSize;
- CFX_RetainPtr<CFX_DIBitmap> m_pDeviceBitmap;
- bool m_bInterpol;
- CFXCODEC_WeightTable m_WeightHorz;
- CFXCODEC_VertTable m_WeightVert;
- CFXCODEC_HorzTable m_WeightHorzOO;
- int m_SrcWidth;
- int m_SrcHeight;
- int m_SrcComponents;
- int m_SrcBPC;
- FX_RECT m_clipBox;
- int m_startX;
- int m_startY;
- int m_sizeX;
- int m_sizeY;
- int m_TransMethod;
- FX_ARGB* m_pSrcPalette;
- int m_SrcPaletteNumber;
- int m_SrcRow;
- FXCodec_Format m_SrcFormat;
- int m_SrcPassNumber;
- int m_FrameNumber;
- int m_FrameCur;
- int m_GifBgIndex;
- uint8_t* m_pGifPalette;
- int32_t m_GifPltNumber;
- int m_GifTransIndex;
- FX_RECT m_GifFrameRect;
- bool m_BmpIsTopBottom;
- FXCODEC_STATUS m_status;
-
// CCodec_PngModule::Delegate
bool PngReadHeader(int width,
int height,
@@ -197,7 +152,7 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
bool BmpInputImagePositionBuf(uint32_t rcd_pos) override;
void BmpReadScanline(int32_t row_num, uint8_t* row_buf) override;
- protected:
+ private:
bool BmpReadMoreData(CCodec_BmpModule* pBmpModule,
FXCODEC_STATUS& err_status);
bool GifReadMoreData(CCodec_GifModule* pGifModule,
@@ -231,6 +186,49 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
void ResampleVertBT(const CFX_RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
double scale_y,
int des_row);
+
+ CFX_RetainPtr<IFX_SeekableReadStream> m_pFile;
+ CFX_RetainPtr<CFX_DIBitmap> m_pDeviceBitmap;
+ CFX_UnownedPtr<CCodec_ModuleMgr> m_pCodecMgr;
+ std::unique_ptr<CCodec_JpegModule::Context> m_pJpegContext;
+ std::unique_ptr<CCodec_PngModule::Context> m_pPngContext;
+ std::unique_ptr<CCodec_GifModule::Context> m_pGifContext;
+ std::unique_ptr<CCodec_BmpModule::Context> m_pBmpContext;
+ std::unique_ptr<CCodec_TiffModule::Context> m_pTiffContext;
+ FXCODEC_IMAGE_TYPE m_imagType;
+ uint32_t m_offSet;
+ uint8_t* m_pSrcBuf;
+ uint32_t m_SrcSize;
+ uint8_t* m_pDecodeBuf;
+ int m_ScanlineSize;
+ bool m_bInterpol;
+ CFXCODEC_WeightTable m_WeightHorz;
+ CFXCODEC_VertTable m_WeightVert;
+ CFXCODEC_HorzTable m_WeightHorzOO;
+ int m_SrcWidth;
+ int m_SrcHeight;
+ int m_SrcComponents;
+ int m_SrcBPC;
+ FX_RECT m_clipBox;
+ int m_startX;
+ int m_startY;
+ int m_sizeX;
+ int m_sizeY;
+ int m_TransMethod;
+ FX_ARGB* m_pSrcPalette;
+ int m_SrcPaletteNumber;
+ int m_SrcRow;
+ FXCodec_Format m_SrcFormat;
+ int m_SrcPassNumber;
+ int m_FrameNumber;
+ int m_FrameCur;
+ int m_GifBgIndex;
+ uint8_t* m_pGifPalette;
+ int32_t m_GifPltNumber;
+ int m_GifTransIndex;
+ FX_RECT m_GifFrameRect;
+ bool m_BmpIsTopBottom;
+ FXCODEC_STATUS m_status;
};
#endif // CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_