Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: core/src/fxcodec/jbig2/JBig2_Context.h

Issue 1332153002: Merge to XFA: Make a bunch of JBig2 classes independent of CJBig2_Object. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_BitStream.h ('k') | core/src/fxcodec/jbig2/JBig2_Context.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 eb0ceb0eb96adfb48a9801c81a2f58e401df3398..0590fd157b3e193cc3b4da886460b79878285c76 100644
--- a/core/src/fxcodec/jbig2/JBig2_Context.h
+++ b/core/src/fxcodec/jbig2/JBig2_Context.h
@@ -10,18 +10,16 @@
#include <list>
#include <utility>
-#include "JBig2_Module.h"
+#include "../../../../third_party/base/nonstd_unique_ptr.h"
+#include "../../../include/fxcodec/fx_codec_def.h"
+#include "JBig2_GeneralDecoder.h"
#include "JBig2_List.h"
-#include "JBig2_Segment.h"
+#include "JBig2_Module.h"
#include "JBig2_Page.h"
-#include "JBig2_GeneralDecoder.h"
-#include "../../../include/fxcodec/fx_codec_def.h"
+#include "JBig2_Segment.h"
+
+using CJBig2_CachePair = std::pair<uint8_t*, CJBig2_SymbolDict*>;
-typedef std::pair<uint8_t*, CJBig2_SymbolDict*> CJBig2_CachePair;
-typedef enum {
- JBIG2_OUT_OF_PAGE = 0,
- JBIG2_IN_PAGE,
-} JBig2State;
#define JBIG2_SUCCESS 0
#define JBIG2_FAILED -1
#define JBIG2_ERROR_TOO_SHORT -2
@@ -36,6 +34,7 @@ typedef enum {
#define JBIG2_RANDOM_STREAM 2
#define JBIG2_EMBED_STREAM 3
#define JBIG2_MIN_SEGMENT_SIZE 11
+
class CJBig2_Context : public CJBig2_Object {
public:
static CJBig2_Context* CreateContext(
@@ -62,6 +61,11 @@ class CJBig2_Context : public CJBig2_Object {
FXCODEC_STATUS GetProcessiveStatus() { return m_ProcessiveStatus; }
private:
+ enum JBig2State {
+ JBIG2_OUT_OF_PAGE = 0,
+ JBIG2_IN_PAGE,
+ };
+
CJBig2_Context(uint8_t* pGlobalData,
FX_DWORD dwGlobalLength,
uint8_t* pData,
@@ -119,22 +123,14 @@ class CJBig2_Context : public CJBig2_Object {
private:
CJBig2_Context* m_pGlobalContext;
-
int32_t m_nStreamType;
-
CJBig2_BitStream* m_pStream;
-
int32_t m_nState;
-
- CJBig2_List<CJBig2_Segment>* m_pSegmentList;
-
- CJBig2_List<JBig2PageInfo>* m_pPageInfoList;
-
+ CJBig2_List<CJBig2_Segment> m_SegmentList;
+ CJBig2_List<JBig2PageInfo> m_PageInfoList;
CJBig2_Image* m_pPage;
-
FX_BOOL m_bBufSpecified;
-
- int32_t m_nSegmentDecoded;
+ size_t m_nSegmentDecoded;
IFX_Pause* m_pPause;
int32_t m_PauseStep;
FXCODEC_STATUS m_ProcessiveStatus;
@@ -142,7 +138,7 @@ class CJBig2_Context : public CJBig2_Object {
CJBig2_ArithDecoder* m_pArithDecoder;
CJBig2_GRDProc* m_pGRD;
JBig2ArithCtx* m_gbContext;
- CJBig2_Segment* m_pSegment;
+ nonstd::unique_ptr<CJBig2_Segment> m_pSegment;
FX_DWORD m_dwOffset;
JBig2RegionInfo m_ri;
std::list<CJBig2_CachePair>* m_pSymbolDictCache;
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_BitStream.h ('k') | core/src/fxcodec/jbig2/JBig2_Context.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698