summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/ccodec_pngmodule.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-31 16:29:29 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-31 23:43:31 +0000
commitdb9faec3c8fb3ced3d8340b2b6ae252b8f40d135 (patch)
treee345adf7b949322e462c48274dd256410a237f51 /core/fxcodec/codec/ccodec_pngmodule.h
parentfc04f41200e4ba4f47f52f188708547e8a1bee6d (diff)
downloadpdfium-db9faec3c8fb3ced3d8340b2b6ae252b8f40d135.tar.xz
Put all CCodec_PngModule state into its context.
Rename FXPNG_Context and use unowned ptr. Clean up context in its dtor. Then create and destroy using |new|. Change-Id: I7b66e6d0da50a16d3b8d5108ffd931bb01145892 Reviewed-on: https://pdfium-review.googlesource.com/6152 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/ccodec_pngmodule.h')
-rw-r--r--core/fxcodec/codec/ccodec_pngmodule.h20
1 files changed, 4 insertions, 16 deletions
diff --git a/core/fxcodec/codec/ccodec_pngmodule.h b/core/fxcodec/codec/ccodec_pngmodule.h
index 2b43f5d8bc..b92e09cc71 100644
--- a/core/fxcodec/codec/ccodec_pngmodule.h
+++ b/core/fxcodec/codec/ccodec_pngmodule.h
@@ -11,12 +11,10 @@
#include "core/fxcrt/fx_system.h"
class CFX_DIBAttribute;
-struct FXPNG_Context;
-
-#define PNG_ERROR_SIZE 256
class CCodec_PngModule {
public:
+ class Context;
class Delegate {
public:
virtual bool PngReadHeader(int width,
@@ -29,22 +27,12 @@ class CCodec_PngModule {
virtual void PngFillScanlineBufCompleted(int pass, int line) = 0;
};
- CCodec_PngModule();
- ~CCodec_PngModule();
-
- FXPNG_Context* Start();
- void Finish(FXPNG_Context* pContext);
- bool Input(FXPNG_Context* pContext,
+ Context* Start(Delegate* pDelegate);
+ void Finish(Context* pContext);
+ bool Input(Context* pContext,
const uint8_t* src_buf,
uint32_t src_size,
CFX_DIBAttribute* pAttribute);
-
- Delegate* GetDelegate() const { return m_pDelegate.Get(); }
- void SetDelegate(Delegate* delegate) { m_pDelegate = delegate; }
-
- protected:
- CFX_UnownedPtr<Delegate> m_pDelegate;
- char m_szLastError[PNG_ERROR_SIZE];
};
#endif // CORE_FXCODEC_CODEC_CCODEC_PNGMODULE_H_