summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/ccodec_pngmodule.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-01 12:15:00 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-03-01 20:43:46 +0000
commitb4a261855b34b4c8d938118762ae609a34a3ae99 (patch)
tree7b084e874cbf41eec73a3cec949dc810983cc0cf /core/fxcodec/codec/ccodec_pngmodule.h
parentfed39cf4a23341cf9cb5a5b432248b4247022282 (diff)
downloadpdfium-b4a261855b34b4c8d938118762ae609a34a3ae99.tar.xz
Create virtual codec APIs so chrome/fuzzers can link separately
The one step to make an actual concrete class is conditionalized in fpdfview and is unconditional in the fuzzer. Also replace the clumsy C-style callbacks with a delegate interface as long as we are making new interfaces. Change-Id: I733a437483ce5e0c34211cfbbda05105336f55b5 Reviewed-on: https://pdfium-review.googlesource.com/2887 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/ccodec_pngmodule.h')
-rw-r--r--core/fxcodec/codec/ccodec_pngmodule.h25
1 files changed, 7 insertions, 18 deletions
diff --git a/core/fxcodec/codec/ccodec_pngmodule.h b/core/fxcodec/codec/ccodec_pngmodule.h
index 77c4af3946..1f3a3d96cc 100644
--- a/core/fxcodec/codec/ccodec_pngmodule.h
+++ b/core/fxcodec/codec/ccodec_pngmodule.h
@@ -7,33 +7,22 @@
#ifndef CORE_FXCODEC_CODEC_CCODEC_PNGMODULE_H_
#define CORE_FXCODEC_CODEC_CCODEC_PNGMODULE_H_
+#include "core/fxcodec/codec/icodec_pngmodule.h"
#include "core/fxcrt/fx_system.h"
-class CFX_DIBAttribute;
-struct FXPNG_Context;
-
#define PNG_ERROR_SIZE 256
-class CCodec_PngModule {
+class CCodec_PngModule : public ICodec_PngModule {
public:
- CCodec_PngModule() { FXSYS_memset(m_szLastError, 0, sizeof(m_szLastError)); }
+ CCodec_PngModule();
+ ~CCodec_PngModule() override;
- FXPNG_Context* Start(void* pModule);
- void Finish(FXPNG_Context* pContext);
+ FXPNG_Context* Start() override;
+ void Finish(FXPNG_Context* pContext) override;
bool Input(FXPNG_Context* pContext,
const uint8_t* src_buf,
uint32_t src_size,
- CFX_DIBAttribute* pAttribute);
-
- bool (*ReadHeaderCallback)(void* pModule,
- int width,
- int height,
- int bpc,
- int pass,
- int* color_type,
- double* gamma);
- bool (*AskScanlineBufCallback)(void* pModule, int line, uint8_t*& src_buf);
- void (*FillScanlineBufCompletedCallback)(void* pModule, int pass, int line);
+ CFX_DIBAttribute* pAttribute) override;
protected:
FX_CHAR m_szLastError[PNG_ERROR_SIZE];