Cleanup parts of fpdf_render_loadimage.cpp.
[pdfium.git] / core / src / fpdfapi / fpdf_render / render_int.h
index e8e8ea4..70c41ca 100644 (file)
@@ -92,7 +92,7 @@ class CPDF_RenderStatus : public CFX_Object
 public:
     CPDF_RenderStatus();
     ~CPDF_RenderStatus();
-    FX_BOOL                    Initialize(int level, class CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix,
+    FX_BOOL                    Initialize(class CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix,
                                const CPDF_PageObject* pStopObj, const CPDF_RenderStatus* pParentStatus,
                                const CPDF_GraphicStates* pInitialStates, const CPDF_RenderOptions* pOptions,
                                int transparency, FX_BOOL bDropObjects, CPDF_Dictionary* pFormResource = NULL,
@@ -155,8 +155,11 @@ protected:
     void                       DitherObjectArea(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
     FX_BOOL                    GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bLogical, FX_RECT &rect) const;
     void                       GetScaledMatrix(CFX_Matrix &matrix) const;
+
 protected:
-    int                                                m_Level;
+    static const int kRenderMaxRecursionDepth = 64;
+    static int s_CurrentRecursionDepth;
+
     CFX_RenderDevice*          m_pDevice;
     CFX_AffineMatrix           m_DeviceMatrix;
     CPDF_ClipPath                      m_LastClipPath;
@@ -412,33 +415,35 @@ public:
     FX_BOOL                            m_bHasMask;
 protected:
     FX_BOOL                            LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources);
+    DIB_COMP_DATA*      GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX_BOOL& bColorKey);
     CPDF_DIBSource*            LoadMask(FX_DWORD& MatteColor);
     CPDF_DIBSource*            LoadMaskDIB(CPDF_Stream* pMask);
     void                               LoadJpxBitmap();
-    void                               LoadJbig2Bitmap();
     void                               LoadPalette();
-    FX_BOOL                            CreateDecoder();
+    int                                        CreateDecoder();
     void                               TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan) const;
-    FX_DWORD            GetValidBpp() const;
+    void                ValidateDictParam();
     CPDF_Document*             m_pDocument;
     const CPDF_Stream* m_pStream;
     CPDF_StreamAcc*            m_pStreamAcc;
     const CPDF_Dictionary*     m_pDict;
     CPDF_ColorSpace*   m_pColorSpace;
-    FX_DWORD                   m_Family, m_bpc, m_nComponents, m_GroupFamily;
+    FX_DWORD                   m_Family;
+    FX_DWORD                   m_bpc;
+    FX_DWORD                   m_bpc_orig;
+    FX_DWORD                   m_nComponents;
+    FX_DWORD                   m_GroupFamily;
     FX_BOOL                            m_bLoadMask;
-    FX_BOOL                            m_bDefaultDecode, m_bImageMask, m_bColorKey;
+    FX_BOOL                            m_bDefaultDecode;
+    FX_BOOL                            m_bImageMask;
+    FX_BOOL                            m_bColorKey;
     DIB_COMP_DATA*             m_pCompData;
     FX_LPBYTE                  m_pLineBuf;
     FX_LPBYTE                  m_pMaskedLine;
     CFX_DIBitmap*              m_pCachedBitmap;
     ICodec_ScanlineDecoder*    m_pDecoder;
 };
-#ifdef _FPDFAPI_MINI_
-#define FPDF_HUGE_IMAGE_SIZE   3000000
-#else
 #define FPDF_HUGE_IMAGE_SIZE   60000000
-#endif
 class CPDF_DIBTransferFunc : public CFX_FilteredDIB
 {
 public: