summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/ccodec_progressivedecoder.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-27 13:51:46 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-03-28 14:14:50 +0000
commit0004f29bf6ee3c6060a272c79f14993e92e053c7 (patch)
treeb82385e4853a157e10148af8d95ebb6bae4fb4c7 /core/fxcodec/codec/ccodec_progressivedecoder.h
parent369fe1f7f9f3a424ee3cf8f992c3128db27fa479 (diff)
downloadpdfium-0004f29bf6ee3c6060a272c79f14993e92e053c7.tar.xz
Refcount all CFX_DIBSources (and subclasses) all the time.
There are currently several ownership models for these objects, including ad-hoc logic for sharing and deletion, and the now-redundant CFX_DIBitmapRef externally-counted handle to the DIBs. Replace them all with the internal refcount scheme. Change-Id: I2db399dfc19219eda384f94cc989353b78ce2872 Reviewed-on: https://pdfium-review.googlesource.com/3166 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/ccodec_progressivedecoder.h')
-rw-r--r--core/fxcodec/codec/ccodec_progressivedecoder.h32
1 files changed, 19 insertions, 13 deletions
diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h
index 61703dde29..cd96ee76a0 100644
--- a/core/fxcodec/codec/ccodec_progressivedecoder.h
+++ b/core/fxcodec/codec/ccodec_progressivedecoder.h
@@ -58,7 +58,7 @@ class CCodec_ProgressiveDecoder : public ICodec_BmpModule::Delegate,
void SetClipBox(FX_RECT* clip);
FXCODEC_STATUS GetFrames(int32_t& frames, IFX_Pause* pPause = nullptr);
- FXCODEC_STATUS StartDecode(CFX_DIBitmap* pDIBitmap,
+ FXCODEC_STATUS StartDecode(const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap,
int start_x,
int start_y,
int size_x,
@@ -138,7 +138,7 @@ class CCodec_ProgressiveDecoder : public ICodec_BmpModule::Delegate,
uint32_t m_SrcSize;
uint8_t* m_pDecodeBuf;
int m_ScanlineSize;
- CFX_DIBitmap* m_pDeviceBitmap;
+ CFX_RetainPtr<CFX_DIBitmap> m_pDeviceBitmap;
bool m_bInterpol;
CFXCODEC_WeightTable m_WeightHorz;
CFXCODEC_VertTable m_WeightVert;
@@ -201,29 +201,35 @@ class CCodec_ProgressiveDecoder : public ICodec_BmpModule::Delegate,
FXCODEC_STATUS& err_status);
bool GifReadMoreData(ICodec_GifModule* pGifModule,
FXCODEC_STATUS& err_status);
- void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap,
- double scale_y,
- int des_row);
- void PngOneOneMapResampleHorz(CFX_DIBitmap* pDeviceBitmap,
- int32_t des_line,
- uint8_t* src_scan,
- FXCodec_Format src_format);
+ void GifDoubleLineResampleVert(
+ const CFX_RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
+ double scale_y,
+ int des_row);
+ void PngOneOneMapResampleHorz(
+ const CFX_RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
+ int32_t des_line,
+ uint8_t* src_scan,
+ FXCodec_Format src_format);
bool DetectImageType(FXCODEC_IMAGE_TYPE imageType,
CFX_DIBAttribute* pAttribute);
void GetDownScale(int& down_scale);
void GetTransMethod(FXDIB_Format des_format, FXCodec_Format src_format);
- void ReSampleScanline(CFX_DIBitmap* pDeviceBitmap,
+ void ReSampleScanline(const CFX_RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
int32_t des_line,
uint8_t* src_scan,
FXCodec_Format src_format);
- void Resample(CFX_DIBitmap* pDeviceBitmap,
+ void Resample(const CFX_RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
int32_t src_line,
uint8_t* src_scan,
FXCodec_Format src_format);
- void ResampleVert(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row);
+ void ResampleVert(const CFX_RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
+ double scale_y,
+ int des_row);
bool JpegReadMoreData(CCodec_JpegModule* pJpegModule,
FXCODEC_STATUS& err_status);
- void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row);
+ void ResampleVertBT(const CFX_RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
+ double scale_y,
+ int des_row);
};
#endif // CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_