diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_Context.cpp | 13 | ||||
-rw-r--r-- | core/fxcodec/jbig2/JBig2_Context.h | 2 | ||||
-rw-r--r-- | core/fxcodec/jbig2/JBig2_GrdProc.cpp | 3 | ||||
-rw-r--r-- | core/fxcodec/jbig2/JBig2_GrdProc.h | 3 | ||||
-rw-r--r-- | core/fxcodec/jbig2/JBig2_GsidProc.cpp | 7 | ||||
-rw-r--r-- | core/fxcodec/jbig2/JBig2_GsidProc.h | 2 | ||||
-rw-r--r-- | core/fxcodec/jbig2/JBig2_HtrdProc.cpp | 5 | ||||
-rw-r--r-- | core/fxcodec/jbig2/JBig2_HtrdProc.h | 2 | ||||
-rw-r--r-- | core/fxcodec/jbig2/JBig2_PddProc.cpp | 5 | ||||
-rw-r--r-- | core/fxcodec/jbig2/JBig2_PddProc.h | 2 | ||||
-rw-r--r-- | core/fxcodec/jbig2/JBig2_SddProc.cpp | 7 | ||||
-rw-r--r-- | core/fxcodec/jbig2/JBig2_SddProc.h | 4 | ||||
-rw-r--r-- | core/fxge/dib/cfx_imagerenderer.cpp | 2 | ||||
-rw-r--r-- | core/fxge/dib/cfx_imagestretcher.cpp | 1 | ||||
-rw-r--r-- | core/fxge/dib/cfx_imagetransformer.cpp | 2 | ||||
-rw-r--r-- | core/fxge/dib/cstretchengine.cpp | 5 |
16 files changed, 26 insertions, 39 deletions
diff --git a/core/fxcodec/jbig2/JBig2_Context.cpp b/core/fxcodec/jbig2/JBig2_Context.cpp index 116abb7754..c9570022bb 100644 --- a/core/fxcodec/jbig2/JBig2_Context.cpp +++ b/core/fxcodec/jbig2/JBig2_Context.cpp @@ -336,7 +336,7 @@ int32_t CJBig2_Context::ProcessingParseSegmentData(CJBig2_Segment* pSegment, IFX_Pause* pPause) { switch (pSegment->m_cFlags.s.type) { case 0: - return parseSymbolDict(pSegment, pPause); + return parseSymbolDict(pSegment); case 4: case 6: case 7: @@ -419,8 +419,7 @@ int32_t CJBig2_Context::ProcessingParseSegmentData(CJBig2_Segment* pSegment, return JBIG2_SUCCESS; } -int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment* pSegment, - IFX_Pause* pPause) { +int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment* pSegment) { uint16_t wFlags; if (m_pStream->readShortInteger(&wFlags) != 0) return JBIG2_ERROR_TOO_SHORT; @@ -612,7 +611,7 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment* pSegment, m_pStream->offset(2); } else { pSegment->m_Result.sd = pSymbolDictDecoder->decode_Huffman( - m_pStream.get(), &gbContext, &grContext, pPause); + m_pStream.get(), &gbContext, &grContext); if (!pSegment->m_Result.sd) return JBIG2_ERROR_FATAL; m_pStream->alignByte(); @@ -967,7 +966,7 @@ int32_t CJBig2_Context::parsePatternDict(CJBig2_Segment* pSegment, m_pStream->alignByte(); m_pStream->offset(2); } else { - pSegment->m_Result.pd = pPDD->decode_MMR(m_pStream.get(), pPause); + pSegment->m_Result.pd = pPDD->decode_MMR(m_pStream.get()); if (!pSegment->m_Result.pd) return JBIG2_ERROR_FATAL; m_pStream->alignByte(); @@ -1033,7 +1032,7 @@ int32_t CJBig2_Context::parseHalftoneRegion(CJBig2_Segment* pSegment, m_pStream->alignByte(); m_pStream->offset(2); } else { - pSegment->m_Result.im = pHRD->decode_MMR(m_pStream.get(), pPause); + pSegment->m_Result.im = pHRD->decode_MMR(m_pStream.get()); if (!pSegment->m_Result.im) return JBIG2_ERROR_FATAL; m_pStream->alignByte(); @@ -1132,7 +1131,7 @@ int32_t CJBig2_Context::parseGenericRegion(CJBig2_Segment* pSegment, m_pStream->offset(2); } } else { - m_pGRD->Start_decode_MMR(&pSegment->m_Result.im, m_pStream.get(), pPause); + m_pGRD->Start_decode_MMR(&pSegment->m_Result.im, m_pStream.get()); if (!pSegment->m_Result.im) { m_pGRD.reset(); return JBIG2_ERROR_FATAL; diff --git a/core/fxcodec/jbig2/JBig2_Context.h b/core/fxcodec/jbig2/JBig2_Context.h index a9fb1e2451..8568aab7e7 100644 --- a/core/fxcodec/jbig2/JBig2_Context.h +++ b/core/fxcodec/jbig2/JBig2_Context.h @@ -71,7 +71,7 @@ class CJBig2_Context { int32_t parseSegmentData(CJBig2_Segment* pSegment, IFX_Pause* pPause); int32_t ProcessingParseSegmentData(CJBig2_Segment* pSegment, IFX_Pause* pPause); - int32_t parseSymbolDict(CJBig2_Segment* pSegment, IFX_Pause* pPause); + int32_t parseSymbolDict(CJBig2_Segment* pSegment); int32_t parseTextRegion(CJBig2_Segment* pSegment); int32_t parsePatternDict(CJBig2_Segment* pSegment, IFX_Pause* pPause); int32_t parseHalftoneRegion(CJBig2_Segment* pSegment, IFX_Pause* pPause); diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrdProc.cpp index 21d6d80bc9..0d9f991d4c 100644 --- a/core/fxcodec/jbig2/JBig2_GrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_GrdProc.cpp @@ -705,8 +705,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith(IFX_Pause* pPause) { } FXCODEC_STATUS CJBig2_GRDProc::Start_decode_MMR(CJBig2_Image** pImage, - CJBig2_BitStream* pStream, - IFX_Pause* pPause) { + CJBig2_BitStream* pStream) { int bitpos, i; *pImage = new CJBig2_Image(GBW, GBH); if (!(*pImage)->m_pData) { diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.h b/core/fxcodec/jbig2/JBig2_GrdProc.h index 1268192ef1..447447fe8b 100644 --- a/core/fxcodec/jbig2/JBig2_GrdProc.h +++ b/core/fxcodec/jbig2/JBig2_GrdProc.h @@ -29,8 +29,7 @@ class CJBig2_GRDProc { JBig2ArithCtx* gbContext, IFX_Pause* pPause); FXCODEC_STATUS Start_decode_MMR(CJBig2_Image** pImage, - CJBig2_BitStream* pStream, - IFX_Pause* pPause); + CJBig2_BitStream* pStream); FXCODEC_STATUS Continue_decode(IFX_Pause* pPause); FX_RECT GetReplaceRect() const { return m_ReplaceRect; } diff --git a/core/fxcodec/jbig2/JBig2_GsidProc.cpp b/core/fxcodec/jbig2/JBig2_GsidProc.cpp index e65b47de62..0f0a16da1b 100644 --- a/core/fxcodec/jbig2/JBig2_GsidProc.cpp +++ b/core/fxcodec/jbig2/JBig2_GsidProc.cpp @@ -68,8 +68,7 @@ uint32_t* CJBig2_GSIDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder, return GSVALS.release(); } -uint32_t* CJBig2_GSIDProc::decode_MMR(CJBig2_BitStream* pStream, - IFX_Pause* pPause) { +uint32_t* CJBig2_GSIDProc::decode_MMR(CJBig2_BitStream* pStream) { auto pGRD = pdfium::MakeUnique<CJBig2_GRDProc>(); pGRD->MMR = GSMMR; pGRD->GBW = GSW; @@ -77,7 +76,7 @@ uint32_t* CJBig2_GSIDProc::decode_MMR(CJBig2_BitStream* pStream, std::unique_ptr<CJBig2_Image*> GSPLANES(FX_Alloc(CJBig2_Image*, GSBPP)); JBIG2_memset(GSPLANES.get(), 0, sizeof(CJBig2_Image*) * GSBPP); - pGRD->Start_decode_MMR(&GSPLANES.get()[GSBPP - 1], pStream, nullptr); + pGRD->Start_decode_MMR(&GSPLANES.get()[GSBPP - 1], pStream); if (!GSPLANES.get()[GSBPP - 1]) return nullptr; @@ -85,7 +84,7 @@ uint32_t* CJBig2_GSIDProc::decode_MMR(CJBig2_BitStream* pStream, pStream->offset(3); int32_t J = GSBPP - 2; while (J >= 0) { - pGRD->Start_decode_MMR(&GSPLANES.get()[J], pStream, nullptr); + pGRD->Start_decode_MMR(&GSPLANES.get()[J], pStream); if (!GSPLANES.get()[J]) { for (int32_t K = GSBPP - 1; K > J; --K) delete GSPLANES.get()[K]; diff --git a/core/fxcodec/jbig2/JBig2_GsidProc.h b/core/fxcodec/jbig2/JBig2_GsidProc.h index 3d5dc2dd4a..45e759968e 100644 --- a/core/fxcodec/jbig2/JBig2_GsidProc.h +++ b/core/fxcodec/jbig2/JBig2_GsidProc.h @@ -21,7 +21,7 @@ class CJBig2_GSIDProc { JBig2ArithCtx* gbContext, IFX_Pause* pPause); - uint32_t* decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause); + uint32_t* decode_MMR(CJBig2_BitStream* pStream); public: bool GSMMR; diff --git a/core/fxcodec/jbig2/JBig2_HtrdProc.cpp b/core/fxcodec/jbig2/JBig2_HtrdProc.cpp index 8899fb1350..1e8710b417 100644 --- a/core/fxcodec/jbig2/JBig2_HtrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_HtrdProc.cpp @@ -68,8 +68,7 @@ CJBig2_Image* CJBig2_HTRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder, return HTREG.release(); } -CJBig2_Image* CJBig2_HTRDProc::decode_MMR(CJBig2_BitStream* pStream, - IFX_Pause* pPause) { +CJBig2_Image* CJBig2_HTRDProc::decode_MMR(CJBig2_BitStream* pStream) { uint32_t ng, mg; int32_t x, y; uint32_t* GI; @@ -85,7 +84,7 @@ CJBig2_Image* CJBig2_HTRDProc::decode_MMR(CJBig2_BitStream* pStream, pGID->GSH = HGH; pGID->GSBPP = (uint8_t)HBPP; pGID->GSUSESKIP = 0; - GI = pGID->decode_MMR(pStream, pPause); + GI = pGID->decode_MMR(pStream); if (!GI) return nullptr; diff --git a/core/fxcodec/jbig2/JBig2_HtrdProc.h b/core/fxcodec/jbig2/JBig2_HtrdProc.h index 9a9a5c59c4..e562123098 100644 --- a/core/fxcodec/jbig2/JBig2_HtrdProc.h +++ b/core/fxcodec/jbig2/JBig2_HtrdProc.h @@ -21,7 +21,7 @@ class CJBig2_HTRDProc { JBig2ArithCtx* gbContext, IFX_Pause* pPause); - CJBig2_Image* decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause); + CJBig2_Image* decode_MMR(CJBig2_BitStream* pStream); public: uint32_t HBW; diff --git a/core/fxcodec/jbig2/JBig2_PddProc.cpp b/core/fxcodec/jbig2/JBig2_PddProc.cpp index 3eef302baf..e3403eec26 100644 --- a/core/fxcodec/jbig2/JBig2_PddProc.cpp +++ b/core/fxcodec/jbig2/JBig2_PddProc.cpp @@ -57,8 +57,7 @@ CJBig2_PatternDict* CJBig2_PDDProc::decode_Arith( return pDict.release(); } -CJBig2_PatternDict* CJBig2_PDDProc::decode_MMR(CJBig2_BitStream* pStream, - IFX_Pause* pPause) { +CJBig2_PatternDict* CJBig2_PDDProc::decode_MMR(CJBig2_BitStream* pStream) { uint32_t GRAY; CJBig2_Image* BHDC = nullptr; auto pDict = pdfium::MakeUnique<CJBig2_PatternDict>(); @@ -70,7 +69,7 @@ CJBig2_PatternDict* CJBig2_PDDProc::decode_MMR(CJBig2_BitStream* pStream, pGRD->MMR = HDMMR; pGRD->GBW = (GRAYMAX + 1) * HDPW; pGRD->GBH = HDPH; - pGRD->Start_decode_MMR(&BHDC, pStream, nullptr); + pGRD->Start_decode_MMR(&BHDC, pStream); if (!BHDC) return nullptr; diff --git a/core/fxcodec/jbig2/JBig2_PddProc.h b/core/fxcodec/jbig2/JBig2_PddProc.h index 578f603122..3bb97d0614 100644 --- a/core/fxcodec/jbig2/JBig2_PddProc.h +++ b/core/fxcodec/jbig2/JBig2_PddProc.h @@ -21,7 +21,7 @@ class CJBig2_PDDProc { JBig2ArithCtx* gbContext, IFX_Pause* pPause); - CJBig2_PatternDict* decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause); + CJBig2_PatternDict* decode_MMR(CJBig2_BitStream* pStream); public: bool HDMMR; diff --git a/core/fxcodec/jbig2/JBig2_SddProc.cpp b/core/fxcodec/jbig2/JBig2_SddProc.cpp index 8e6c4ac304..e296e32d21 100644 --- a/core/fxcodec/jbig2/JBig2_SddProc.cpp +++ b/core/fxcodec/jbig2/JBig2_SddProc.cpp @@ -6,7 +6,9 @@ #include "core/fxcodec/jbig2/JBig2_SddProc.h" +#include <algorithm> #include <memory> +#include <utility> #include <vector> #include "core/fxcodec/jbig2/JBig2_ArithIntDecoder.h" @@ -263,8 +265,7 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Arith( CJBig2_SymbolDict* CJBig2_SDDProc::decode_Huffman( CJBig2_BitStream* pStream, std::vector<JBig2ArithCtx>* gbContext, - std::vector<JBig2ArithCtx>* grContext, - IFX_Pause* pPause) { + std::vector<JBig2ArithCtx>* grContext) { std::vector<std::unique_ptr<CJBig2_Image>> SDNEWSYMS; std::vector<uint32_t> SDNEWSYMWIDTHS; uint32_t HCHEIGHT, NSYMSDECODED; @@ -488,7 +489,7 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Huffman( pGRD->MMR = 1; pGRD->GBW = TOTWIDTH; pGRD->GBH = HCHEIGHT; - pGRD->Start_decode_MMR(&BHC, pStream, nullptr); + pGRD->Start_decode_MMR(&BHC, pStream); pStream->alignByte(); } nTmp = 0; diff --git a/core/fxcodec/jbig2/JBig2_SddProc.h b/core/fxcodec/jbig2/JBig2_SddProc.h index 86479c7231..20e0569935 100644 --- a/core/fxcodec/jbig2/JBig2_SddProc.h +++ b/core/fxcodec/jbig2/JBig2_SddProc.h @@ -16,7 +16,6 @@ class CJBig2_BitStream; class CJBig2_HuffmanTable; class CJBig2_Image; class CJBig2_SymbolDict; -class IFX_Pause; class CJBig2_SDDProc { public: @@ -26,8 +25,7 @@ class CJBig2_SDDProc { CJBig2_SymbolDict* decode_Huffman(CJBig2_BitStream* pStream, std::vector<JBig2ArithCtx>* gbContext, - std::vector<JBig2ArithCtx>* grContext, - IFX_Pause* pPause); + std::vector<JBig2ArithCtx>* grContext); bool SDHUFF; bool SDREFAGG; diff --git a/core/fxge/dib/cfx_imagerenderer.cpp b/core/fxge/dib/cfx_imagerenderer.cpp index aa818555b6..cff95fdd70 100644 --- a/core/fxge/dib/cfx_imagerenderer.cpp +++ b/core/fxge/dib/cfx_imagerenderer.cpp @@ -101,10 +101,8 @@ bool CFX_ImageRenderer::Start(const CFX_RetainPtr<CFX_DIBitmap>& pDevice, bool CFX_ImageRenderer::Continue(IFX_Pause* pPause) { if (m_Status == 1) return m_Stretcher->Continue(pPause); - if (m_Status != 2) return false; - if (m_pTransformer->Continue(pPause)) return true; diff --git a/core/fxge/dib/cfx_imagestretcher.cpp b/core/fxge/dib/cfx_imagestretcher.cpp index e0ba750c3c..d633318feb 100644 --- a/core/fxge/dib/cfx_imagestretcher.cpp +++ b/core/fxge/dib/cfx_imagestretcher.cpp @@ -128,7 +128,6 @@ bool CFX_ImageStretcher::Start() { bool CFX_ImageStretcher::Continue(IFX_Pause* pPause) { if (m_Flags & FXDIB_DOWNSAMPLE) return ContinueQuickStretch(pPause); - return ContinueStretch(pPause); } diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp index b34c555a76..4b5fe0b0e0 100644 --- a/core/fxge/dib/cfx_imagetransformer.cpp +++ b/core/fxge/dib/cfx_imagetransformer.cpp @@ -262,10 +262,8 @@ bool CFX_ImageTransformer::Continue(IFX_Pause* pPause) { if (m_Status == 2) return m_Stretcher->Continue(pPause); - if (m_Status != 3) return false; - if (m_Stretcher->Continue(pPause)) return true; diff --git a/core/fxge/dib/cstretchengine.cpp b/core/fxge/dib/cstretchengine.cpp index 0025331486..9fdaa02f95 100644 --- a/core/fxge/dib/cstretchengine.cpp +++ b/core/fxge/dib/cstretchengine.cpp @@ -357,9 +357,9 @@ CStretchEngine::~CStretchEngine() { bool CStretchEngine::Continue(IFX_Pause* pPause) { while (m_State == 1) { - if (ContinueStretchHorz(pPause)) { + if (ContinueStretchHorz(pPause)) return true; - } + m_State = 2; StretchVert(); } @@ -401,7 +401,6 @@ bool CStretchEngine::StartStretchHorz() { bool CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) { if (!m_DestWidth) return false; - if (m_pSource->SkipToScanline(m_CurRow, pPause)) return true; |