summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_pagerendercache.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-05 14:46:57 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-05 14:46:57 +0000
commitb05836511dfab9483438fc8dcbab2f4ae6dcc1b1 (patch)
tree3b66bc8e99f995e4b1faf9a01d7a32833dd6a0cd /core/fpdfapi/render/cpdf_pagerendercache.cpp
parente9b55327048158958d75ab3577a002084d3aed1b (diff)
downloadpdfium-b05836511dfab9483438fc8dcbab2f4ae6dcc1b1.tar.xz
Change return types for some rendering Start/Continue methods.
Either return a bool or a CPDF_DIBSource::LoadState. Explain what the bool return value means. Change-Id: I6346d0cd61d5faee5290df181cfff3b9e4d5d84e Reviewed-on: https://pdfium-review.googlesource.com/27851 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/render/cpdf_pagerendercache.cpp')
-rw-r--r--core/fpdfapi/render/cpdf_pagerendercache.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/fpdfapi/render/cpdf_pagerendercache.cpp b/core/fpdfapi/render/cpdf_pagerendercache.cpp
index 0d01589af3..781f18f0e0 100644
--- a/core/fpdfapi/render/cpdf_pagerendercache.cpp
+++ b/core/fpdfapi/render/cpdf_pagerendercache.cpp
@@ -94,17 +94,17 @@ bool CPDF_PageRenderCache::StartGetCachedBitmap(
m_pCurImageCacheEntry =
new CPDF_ImageCacheEntry(m_pPage->m_pDocument.Get(), pImage);
}
- int ret = m_pCurImageCacheEntry->StartGetCachedBitmap(
+ CPDF_DIBSource::LoadState ret = m_pCurImageCacheEntry->StartGetCachedBitmap(
pRenderStatus->GetFormResource(), m_pPage->m_pPageResources.Get(), bStdCS,
GroupFamily, bLoadMask, pRenderStatus);
- if (ret == 2)
+ if (ret == CPDF_DIBSource::LoadState::kContinue)
return true;
m_nTimeCount++;
if (!m_bCurFindCache)
m_ImageCache[pStream] = m_pCurImageCacheEntry;
- if (!ret)
+ if (ret == CPDF_DIBSource::LoadState::kFail)
m_nCacheSize += m_pCurImageCacheEntry->EstimateSize();
return false;
@@ -112,8 +112,8 @@ bool CPDF_PageRenderCache::StartGetCachedBitmap(
bool CPDF_PageRenderCache::Continue(IFX_PauseIndicator* pPause,
CPDF_RenderStatus* pRenderStatus) {
- int ret = m_pCurImageCacheEntry->Continue(pPause, pRenderStatus);
- if (ret == 2)
+ bool ret = m_pCurImageCacheEntry->Continue(pPause, pRenderStatus);
+ if (ret)
return true;
m_nTimeCount++;
@@ -121,8 +121,7 @@ bool CPDF_PageRenderCache::Continue(IFX_PauseIndicator* pPause,
m_ImageCache[m_pCurImageCacheEntry->GetImage()->GetStream()] =
m_pCurImageCacheEntry;
}
- if (!ret)
- m_nCacheSize += m_pCurImageCacheEntry->EstimateSize();
+ m_nCacheSize += m_pCurImageCacheEntry->EstimateSize();
return false;
}