Index: core/src/fxcodec/jbig2/JBig2_Context.h |
diff --git a/core/src/fxcodec/jbig2/JBig2_Context.h b/core/src/fxcodec/jbig2/JBig2_Context.h |
index 3c283d1d5bae2606374b375c560fb381239ecfd0..017ffa3d9da3d1b7b0dd2ce1499e77822ad6b928 100644 |
--- a/core/src/fxcodec/jbig2/JBig2_Context.h |
+++ b/core/src/fxcodec/jbig2/JBig2_Context.h |
@@ -11,6 +11,7 @@ |
#include <utility> |
#include "../../../../third_party/base/nonstd_unique_ptr.h" |
+#include "../../../include/fpdfapi/fpdf_objects.h" |
#include "../../../include/fxcodec/fx_codec_def.h" |
#include "JBig2_List.h" |
#include "JBig2_Page.h" |
@@ -19,7 +20,10 @@ |
class CJBig2_GRDProc; |
class IFX_Pause; |
-using CJBig2_CachePair = std::pair<const uint8_t*, CJBig2_SymbolDict*>; |
+// Cache is keyed by the ObjNum of a stream and an index within the stream. |
+using CJBig2_CacheKey = std::pair<FX_DWORD, FX_DWORD>; |
+// NB: CJBig2_SymbolDict* is owned. |
+using CJBig2_CachePair = std::pair<CJBig2_CacheKey, CJBig2_SymbolDict*>; |
#define JBIG2_SUCCESS 0 |
#define JBIG2_FAILED -1 |
@@ -35,10 +39,8 @@ using CJBig2_CachePair = std::pair<const uint8_t*, CJBig2_SymbolDict*>; |
class CJBig2_Context { |
public: |
static CJBig2_Context* CreateContext( |
- const uint8_t* pGlobalData, |
- FX_DWORD dwGlobalLength, |
- const uint8_t* pData, |
- FX_DWORD dwLength, |
+ CPDF_StreamAcc* pGlobalStream, |
+ CPDF_StreamAcc* pSrcStream, |
std::list<CJBig2_CachePair>* pSymbolDictCache, |
IFX_Pause* pPause = NULL); |
@@ -54,12 +56,11 @@ class CJBig2_Context { |
FXCODEC_STATUS GetProcessingStatus() { return m_ProcessingStatus; } |
private: |
- CJBig2_Context(const uint8_t* pGlobalData, |
- FX_DWORD dwGlobalLength, |
- const uint8_t* pData, |
- FX_DWORD dwLength, |
+ CJBig2_Context(CPDF_StreamAcc* pGlobalStream, |
+ CPDF_StreamAcc* pSrcStream, |
std::list<CJBig2_CachePair>* pSymbolDictCache, |
- IFX_Pause* pPause); |
+ IFX_Pause* pPause, |
+ bool bIsGlobal); |
~CJBig2_Context(); |
@@ -125,6 +126,7 @@ class CJBig2_Context { |
FX_DWORD m_dwOffset; |
JBig2RegionInfo m_ri; |
std::list<CJBig2_CachePair>* const m_pSymbolDictCache; |
+ bool m_bIsGlobal; |
}; |
#endif // CORE_SRC_FXCODEC_JBIG2_JBIG2_CONTEXT_H_ |