summaryrefslogtreecommitdiff
path: root/core/fxcodec/lgif/cgifcontext.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-06-01 10:18:53 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-01 19:12:48 +0000
commit5f34d479d06ebab9079c2d0704dee872cc45dd86 (patch)
treeabcde4e8d564fbfbc2e1c89e96ba2d30e74be1e8 /core/fxcodec/lgif/cgifcontext.h
parent1fed5a255f03232f74db882bb0d39df340479da4 (diff)
downloadpdfium-5f34d479d06ebab9079c2d0704dee872cc45dd86.tar.xz
Move CCodec_GifModule state to CGifContext
Introduce a base CCodec_GifModule::Context class with a virtual destructor so holders of unique_ptr's to these can delete them without actually having any knowledge of the implementation details of the context. Bug: 728669 Change-Id: Ia50f94300924a1053c326984eac3b03f25f1b83c Reviewed-on: https://pdfium-review.googlesource.com/6190 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec/lgif/cgifcontext.h')
-rw-r--r--core/fxcodec/lgif/cgifcontext.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/core/fxcodec/lgif/cgifcontext.h b/core/fxcodec/lgif/cgifcontext.h
index 20d640ef35..fa46b14559 100644
--- a/core/fxcodec/lgif/cgifcontext.h
+++ b/core/fxcodec/lgif/cgifcontext.h
@@ -10,16 +10,16 @@
#include <memory>
#include <vector>
+#include "core/fxcodec/codec/ccodec_gifmodule.h"
#include "core/fxcodec/lgif/fx_gif.h"
#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxcrt/fx_basic.h"
-class CCodec_GifModule;
-
-class CGifContext {
+class CGifContext : public CCodec_GifModule::Context {
public:
- CGifContext(CCodec_GifModule* gif_module, char* error_string);
- ~CGifContext();
+ CGifContext(CCodec_GifModule* gif_module,
+ CCodec_GifModule::Delegate* pDelegate);
+ ~CGifContext() override;
void AddError(const char* err_msg);
void RecordCurrentPosition(uint32_t* cur_pos_ptr);
@@ -37,6 +37,8 @@ class CGifContext {
int32_t disposal_method,
bool interlace);
+ CFX_UnownedPtr<CCodec_GifModule> m_pModule;
+ CFX_UnownedPtr<CCodec_GifModule::Delegate> m_pDelegate;
std::vector<GifPalette> m_GlobalPalette;
int32_t global_pal_num;
uint32_t img_row_offset;
@@ -44,23 +46,19 @@ class CGifContext {
uint32_t avail_in;
int32_t decode_status;
uint32_t skip_size;
-
- CFX_UnownedPtr<CCodec_GifModule> m_Module;
- char* err_ptr;
CFX_ByteString cmt_data;
std::unique_ptr<GifGCE> m_GifGCE;
uint8_t* next_in;
std::vector<std::unique_ptr<GifImage>> m_Images;
std::unique_ptr<CGifLZWDecoder> m_ImgDecoder;
-
int width;
int height;
-
uint8_t bc_index;
uint8_t pixel_aspect;
uint8_t global_sort_flag;
uint8_t global_color_resolution;
uint8_t img_pass_num;
+ char m_szLastError[GIF_MAX_ERROR_SIZE];
};
#endif // CORE_FXCODEC_LGIF_CGIFCONTEXT_H_