From 921cc2403a9e643dfb29d70564fa435a1d79f972 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 8 Oct 2015 15:14:24 -0700 Subject: Merge to XFA: Various changes to JBig2 cache: - Makes the cache be per-document - Keys the cache on ObjNum and stream offset instead of keying on a pointer to the data (which can result in false cache hits). - Makes it so the cache is only used for the globals stream. - Reenable the cache. R=dml@google.com TBR=dml@google.com BUG=pdfium:207 Review URL: https://codereview.chromium.org/1380243004 . (cherry picked from commit f1b88e76134808f36f16b9e53a2e9dd89b12c8fd) Review URL: https://codereview.chromium.org/1394373002 . --- core/src/fxcodec/codec/codec_int.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'core/src/fxcodec/codec/codec_int.h') diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h index 043f62f0e3..e26b542976 100644 --- a/core/src/fxcodec/codec/codec_int.h +++ b/core/src/fxcodec/codec/codec_int.h @@ -357,10 +357,8 @@ class CCodec_Jbig2Context { FX_DWORD m_width; FX_DWORD m_height; - uint8_t* m_src_buf; - FX_DWORD m_src_size; - const uint8_t* m_global_data; - FX_DWORD m_global_size; + CPDF_StreamAcc* m_pGlobalStream; + CPDF_StreamAcc* m_pSrcStream; uint8_t* m_dest_buf; FX_DWORD m_dest_pitch; IFX_Pause* m_pPause; @@ -375,21 +373,17 @@ class CCodec_Jbig2Module : public ICodec_Jbig2Module { // ICodec_Jbig2Module void* CreateJbig2Context() override; FXCODEC_STATUS StartDecode(void* pJbig2Context, + CFX_PrivateData* pPrivateData, FX_DWORD width, FX_DWORD height, - const uint8_t* src_buf, - FX_DWORD src_size, - const uint8_t* global_data, - FX_DWORD global_size, + CPDF_StreamAcc* src_stream, + CPDF_StreamAcc* global_stream, uint8_t* dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause) override; FXCODEC_STATUS ContinueDecode(void* pJbig2Context, IFX_Pause* pPause) override; void DestroyJbig2Context(void* pJbig2Context) override; - - private: - std::list m_SymbolDictCache; }; class CFX_DIBAttributeExif : public IFX_DIBAttributeExif { public: -- cgit v1.2.3