summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/codec
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2015-01-05 10:48:34 -0800
committerBo Xu <bo_xu@foxitsoftware.com>2015-01-05 10:57:11 -0800
commitac1d7212cd1210548551618dd67c780af8a7f0e0 (patch)
tree147b71bbd205b020e2e340855babf82dfde67dde /core/src/fxcodec/codec
parent58043314d81b991f4ab44c43a2847b465a43d085 (diff)
downloadpdfium-ac1d7212cd1210548551618dd67c780af8a7f0e0.tar.xz
XFA: merge patch from CL 828183002, remove static declared SymbolDictCache
Remove static declared SymbolDictCache. This is a follow up CL on https://codereview.chromium.org/761313004/ BUG=https://code.google.com/p/pdfium/issues/detail?id=93 R=brucedawson@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/828183002
Diffstat (limited to 'core/src/fxcodec/codec')
-rw-r--r--core/src/fxcodec/codec/codec_int.h6
-rw-r--r--core/src/fxcodec/codec/fx_codec_jbig.cpp8
2 files changed, 8 insertions, 6 deletions
diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h
index 3cbdce9265..be71bf8dd9 100644
--- a/core/src/fxcodec/codec/codec_int.h
+++ b/core/src/fxcodec/codec/codec_int.h
@@ -5,6 +5,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include <limits.h>
+#include <list>
+#include "../jbig2/JBig2_Context.h"
class CCodec_BasicModule : public ICodec_BasicModule
{
public:
@@ -258,8 +260,7 @@ public:
virtual FX_BOOL LoadFrameInfo(FX_LPVOID ctx, FX_INT32 frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute = NULL);
virtual FX_BOOL Decode(FX_LPVOID ctx, class CFX_DIBitmap* pDIBitmap);
virtual void DestroyDecoder(FX_LPVOID ctx);
-};
-#include "../jbig2/JBig2_Context.h"
+};
class CPDF_Jbig2Interface : public CFX_Object, public CJBig2_Module
{
public:
@@ -331,6 +332,7 @@ public:
FXCODEC_STATUS ContinueDecode(void* pJbig2Context, IFX_Pause* pPause);
void DestroyJbig2Context(void* pJbig2Context);
CPDF_Jbig2Interface m_Module;
+ std::list<CJBig2_CachePair> m_SymbolDictCache;
private:
};
class CFX_DIBAttributeExif : public IFX_DIBAttributeExif
diff --git a/core/src/fxcodec/codec/fx_codec_jbig.cpp b/core/src/fxcodec/codec/fx_codec_jbig.cpp
index 996ad60f8a..173f7a7d36 100644
--- a/core/src/fxcodec/codec/fx_codec_jbig.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jbig.cpp
@@ -30,7 +30,7 @@ FX_BOOL CCodec_Jbig2Module::Decode(FX_DWORD width, FX_DWORD height, FX_LPCBYTE s
{
FXSYS_memset32(dest_buf, 0, height * dest_pitch);
CJBig2_Context* pContext = CJBig2_Context::CreateContext(&m_Module,
- (FX_LPBYTE)global_data, global_size, (FX_LPBYTE)src_buf, src_size, JBIG2_EMBED_STREAM);
+ (FX_LPBYTE)global_data, global_size, (FX_LPBYTE)src_buf, src_size, JBIG2_EMBED_STREAM, &m_SymbolDictCache);
if (pContext == NULL) {
return FALSE;
}
@@ -60,7 +60,7 @@ FX_BOOL CCodec_Jbig2Module::Decode(IFX_FileRead* file_ptr,
if(!file_ptr->ReadBlock(src_buf, 0, src_size)) {
goto failed;
}
- pContext = CJBig2_Context::CreateContext(&m_Module, NULL, 0, src_buf, src_size, JBIG2_FILE_STREAM);
+ pContext = CJBig2_Context::CreateContext(&m_Module, NULL, 0, src_buf, src_size, JBIG2_FILE_STREAM, &m_SymbolDictCache);
if(pContext == NULL) {
goto failed;
}
@@ -102,7 +102,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context, FX_DWORD wid
m_pJbig2Context->m_bFileReader = FALSE;
FXSYS_memset32(dest_buf, 0, height * dest_pitch);
m_pJbig2Context->m_pContext = CJBig2_Context::CreateContext(&m_Module,
- (FX_LPBYTE)global_data, global_size, (FX_LPBYTE)src_buf, src_size, JBIG2_EMBED_STREAM, pPause);
+ (FX_LPBYTE)global_data, global_size, (FX_LPBYTE)src_buf, src_size, JBIG2_EMBED_STREAM, &m_SymbolDictCache, pPause);
if(!m_pJbig2Context->m_pContext) {
return FXCODEC_STATUS_ERROR;
}
@@ -140,7 +140,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context, IFX_FileRead
if(!file_ptr->ReadBlock((void*)m_pJbig2Context->m_src_buf, 0, m_pJbig2Context->m_src_size)) {
goto failed;
}
- m_pJbig2Context->m_pContext = CJBig2_Context::CreateContext(&m_Module, NULL, 0, m_pJbig2Context->m_src_buf, m_pJbig2Context->m_src_size, JBIG2_FILE_STREAM, pPause);
+ m_pJbig2Context->m_pContext = CJBig2_Context::CreateContext(&m_Module, NULL, 0, m_pJbig2Context->m_src_buf, m_pJbig2Context->m_src_size, JBIG2_FILE_STREAM, &m_SymbolDictCache, pPause);
if(m_pJbig2Context->m_pContext == NULL) {
goto failed;
}