diff options
author | Lei Zhang <thestig@chromium.org> | 2017-09-19 14:18:48 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-20 01:28:25 +0000 |
commit | 4b8d363ceed5437ee6a23563f69ba0a73d90413c (patch) | |
tree | f46c67c8a23318ea2d71035ca60355998e9daf20 /core/fxcodec/codec/fx_codec.cpp | |
parent | 89bf9ce294d83669922443dd17391e8c38e720a8 (diff) | |
download | pdfium-4b8d363ceed5437ee6a23563f69ba0a73d90413c.tar.xz |
Move CCodec_ScanlineDecoder to its own file.
Change-Id: Icacf877e2b66ca7d49637dcf9eaec0f99bcdd8bb
Reviewed-on: https://pdfium-review.googlesource.com/14390
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/fx_codec.cpp')
-rw-r--r-- | core/fxcodec/codec/fx_codec.cpp | 66 |
1 files changed, 1 insertions, 65 deletions
diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp index 2681f72199..6bcea4b48e 100644 --- a/core/fxcodec/codec/fx_codec.cpp +++ b/core/fxcodec/codec/fx_codec.cpp @@ -12,10 +12,10 @@ #include <tuple> #include <utility> +#include "core/fxcodec/codec/ccodec_scanlinedecoder.h" #include "core/fxcodec/codec/codec_int.h" #include "core/fxcrt/fx_extension.h" #include "core/fxcrt/fx_safe_types.h" -#include "core/fxcrt/ifx_pauseindicator.h" #include "third_party/base/logging.h" #include "third_party/base/ptr_util.h" @@ -1350,70 +1350,6 @@ CCodec_ModuleMgr::CCodec_ModuleMgr() CCodec_ModuleMgr::~CCodec_ModuleMgr() {} -CCodec_ScanlineDecoder::CCodec_ScanlineDecoder() - : CCodec_ScanlineDecoder(0, 0, 0, 0, 0, 0, 0) {} - -CCodec_ScanlineDecoder::CCodec_ScanlineDecoder(int nOrigWidth, - int nOrigHeight, - int nOutputWidth, - int nOutputHeight, - int nComps, - int nBpc, - uint32_t nPitch) - : m_OrigWidth(nOrigWidth), - m_OrigHeight(nOrigHeight), - m_OutputWidth(nOutputWidth), - m_OutputHeight(nOutputHeight), - m_nComps(nComps), - m_bpc(nBpc), - m_Pitch(nPitch), - m_NextLine(-1), - m_pLastScanline(nullptr) {} - -CCodec_ScanlineDecoder::~CCodec_ScanlineDecoder() {} - -const uint8_t* CCodec_ScanlineDecoder::GetScanline(int line) { - if (m_NextLine == line + 1) - return m_pLastScanline; - - if (m_NextLine < 0 || m_NextLine > line) { - if (!v_Rewind()) - return nullptr; - m_NextLine = 0; - } - while (m_NextLine < line) { - ReadNextLine(); - m_NextLine++; - } - m_pLastScanline = ReadNextLine(); - m_NextLine++; - return m_pLastScanline; -} - -bool CCodec_ScanlineDecoder::SkipToScanline(int line, - IFX_PauseIndicator* pPause) { - if (m_NextLine == line || m_NextLine == line + 1) - return false; - - if (m_NextLine < 0 || m_NextLine > line) { - v_Rewind(); - m_NextLine = 0; - } - m_pLastScanline = nullptr; - while (m_NextLine < line) { - m_pLastScanline = ReadNextLine(); - m_NextLine++; - if (pPause && pPause->NeedToPauseNow()) { - return true; - } - } - return false; -} - -uint8_t* CCodec_ScanlineDecoder::ReadNextLine() { - return v_GetNextLine(); -} - bool CCodec_BasicModule::RunLengthEncode(const uint8_t* src_buf, uint32_t src_size, uint8_t** dest_buf, |