summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_dibsource.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-05 14:39:37 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-05 14:39:37 +0000
commite9b55327048158958d75ab3577a002084d3aed1b (patch)
tree1103a45105d4dfb602db1489d3d3625be634ea39 /core/fpdfapi/render/cpdf_dibsource.cpp
parent9a7c2396705a23d1ce6bdba0025eb2316ae301c4 (diff)
downloadpdfium-e9b55327048158958d75ab3577a002084d3aed1b.tar.xz
Add CPDF_DIBSource::LoadState enum class.
Change-Id: I97819912e564e4b52fcdae4ce7f865188fb1a520 Reviewed-on: https://pdfium-review.googlesource.com/27850 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/render/cpdf_dibsource.cpp')
-rw-r--r--core/fpdfapi/render/cpdf_dibsource.cpp37
1 files changed, 7 insertions, 30 deletions
diff --git a/core/fpdfapi/render/cpdf_dibsource.cpp b/core/fpdfapi/render/cpdf_dibsource.cpp
index 48715d2ecb..1a35826232 100644
--- a/core/fpdfapi/render/cpdf_dibsource.cpp
+++ b/core/fpdfapi/render/cpdf_dibsource.cpp
@@ -108,30 +108,7 @@ const int kMaxImageDimension = 0x01FFFF;
} // namespace
-CPDF_DIBSource::CPDF_DIBSource()
- : m_pDocument(nullptr),
- m_pStream(nullptr),
- m_pDict(nullptr),
- m_pColorSpace(nullptr),
- m_Family(0),
- m_bpc(0),
- m_bpc_orig(0),
- m_nComponents(0),
- m_GroupFamily(0),
- m_MatteColor(0),
- m_bLoadMask(false),
- m_bDefaultDecode(true),
- m_bImageMask(false),
- m_bDoBpcCheck(true),
- m_bColorKey(false),
- m_bHasMask(false),
- m_bStdCS(false),
- m_pCompData(nullptr),
- m_pLineBuf(nullptr),
- m_pMaskedLine(nullptr),
- m_pMask(nullptr),
- m_pMaskStream(nullptr),
- m_Status(0) {}
+CPDF_DIBSource::CPDF_DIBSource() {}
CPDF_DIBSource::~CPDF_DIBSource() {
FX_Free(m_pMaskedLine);
@@ -310,10 +287,10 @@ int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc,
}
int CPDF_DIBSource::ContinueLoadDIBSource(IFX_PauseIndicator* pPause) {
- if (m_Status == 2)
+ if (m_Status == LoadState::kContinue)
return ContinueLoadMaskDIB(pPause);
- if (m_Status != 1)
+ if (m_Status == LoadState::kFail)
return 0;
const ByteString& decoder = m_pStreamAcc->GetImageDecoder();
@@ -352,7 +329,7 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_PauseIndicator* pPause) {
int iContinueStatus = 1;
if (m_bHasMask) {
iContinueStatus = ContinueLoadMaskDIB(pPause);
- m_Status = 2;
+ m_Status = LoadState::kContinue;
}
if (iContinueStatus == 2)
return 2;
@@ -493,7 +470,7 @@ int CPDF_DIBSource::CreateDecoder() {
m_pCachedBitmap.Reset();
return 0;
}
- m_Status = 1;
+ m_Status = LoadState::kSuccess;
return 2;
}
@@ -731,8 +708,8 @@ int CPDF_DIBSource::StartLoadMaskDIB() {
int ret = m_pMask->StartLoadDIBSource(m_pDocument.Get(), m_pMaskStream.Get(),
false, nullptr, nullptr, true);
if (ret == 2) {
- if (m_Status == 0)
- m_Status = 2;
+ if (m_Status == LoadState::kFail)
+ m_Status = LoadState::kContinue;
return 2;
}
if (!ret) {