summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/fx_codec_tiff.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-12 11:21:22 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-12 11:21:23 -0700
commitd55e11eeb8ebf1e226a1166f395ba77248ce84c3 (patch)
treec28b1c1d6ac1597e569618cdeb02e3e0009bf8ed /core/fxcodec/codec/fx_codec_tiff.cpp
parentea98238666e33cd16b69cb23dcaca047c21c9998 (diff)
downloadpdfium-d55e11eeb8ebf1e226a1166f395ba77248ce84c3.tar.xz
Remove ICodec_* Interfaces.
All of the ICodec_* interfaces had a single implementation. This CL removes the interfaces and uses the concrete classes in their place. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1876023003
Diffstat (limited to 'core/fxcodec/codec/fx_codec_tiff.cpp')
-rw-r--r--core/fxcodec/codec/fx_codec_tiff.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/core/fxcodec/codec/fx_codec_tiff.cpp b/core/fxcodec/codec/fx_codec_tiff.cpp
index f0f2ab2e96..d4dc139265 100644
--- a/core/fxcodec/codec/fx_codec_tiff.cpp
+++ b/core/fxcodec/codec/fx_codec_tiff.cpp
@@ -512,33 +512,35 @@ FX_BOOL CCodec_TiffContext::Decode(CFX_DIBitmap* pDIBitmap) {
}
return FALSE;
}
-void* CCodec_TiffModule::CreateDecoder(IFX_FileRead* file_ptr) {
+
+CCodec_TiffContext* CCodec_TiffModule::CreateDecoder(IFX_FileRead* file_ptr) {
CCodec_TiffContext* pDecoder = new CCodec_TiffContext;
if (!pDecoder->InitDecoder(file_ptr)) {
delete pDecoder;
- return NULL;
+ return nullptr;
}
return pDecoder;
}
-void CCodec_TiffModule::GetFrames(void* ctx, int32_t& frames) {
- CCodec_TiffContext* pDecoder = (CCodec_TiffContext*)ctx;
- pDecoder->GetFrames(frames);
+
+void CCodec_TiffModule::GetFrames(CCodec_TiffContext* ctx, int32_t& frames) {
+ ctx->GetFrames(frames);
}
-FX_BOOL CCodec_TiffModule::LoadFrameInfo(void* ctx,
+
+FX_BOOL CCodec_TiffModule::LoadFrameInfo(CCodec_TiffContext* ctx,
int32_t frame,
uint32_t& width,
uint32_t& height,
uint32_t& comps,
uint32_t& bpc,
CFX_DIBAttribute* pAttribute) {
- CCodec_TiffContext* pDecoder = (CCodec_TiffContext*)ctx;
- return pDecoder->LoadFrameInfo(frame, width, height, comps, bpc, pAttribute);
+ return ctx->LoadFrameInfo(frame, width, height, comps, bpc, pAttribute);
}
-FX_BOOL CCodec_TiffModule::Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) {
- CCodec_TiffContext* pDecoder = (CCodec_TiffContext*)ctx;
- return pDecoder->Decode(pDIBitmap);
+
+FX_BOOL CCodec_TiffModule::Decode(CCodec_TiffContext* ctx,
+ class CFX_DIBitmap* pDIBitmap) {
+ return ctx->Decode(pDIBitmap);
}
-void CCodec_TiffModule::DestroyDecoder(void* ctx) {
- CCodec_TiffContext* pDecoder = (CCodec_TiffContext*)ctx;
- delete pDecoder;
+
+void CCodec_TiffModule::DestroyDecoder(CCodec_TiffContext* ctx) {
+ delete ctx;
}