summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-02 18:58:16 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-02 18:58:16 +0000
commit66601c4c3d89afc6b9b41a5d14359fe94222cc3a (patch)
treebf19226ec5fc8c28e28af1e39c2c06b5ec72b898 /core/fpdfapi/render
parent25b3a605f3f8b57fc5281973e21587304ce3e803 (diff)
downloadpdfium-66601c4c3d89afc6b9b41a5d14359fe94222cc3a.tar.xz
Remove dead code in CPDF_PageRenderCache::ResetBitmap().
Callers only ever pass in nullptr for the bitmap parameter. Change-Id: Iefeb72a1268521a38b3d5ab4b03163b67bf35796 Reviewed-on: https://pdfium-review.googlesource.com/43210 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r--core/fpdfapi/render/cpdf_pagerendercache.cpp17
-rw-r--r--core/fpdfapi/render/cpdf_pagerendercache.h4
2 files changed, 7 insertions, 14 deletions
diff --git a/core/fpdfapi/render/cpdf_pagerendercache.cpp b/core/fpdfapi/render/cpdf_pagerendercache.cpp
index 61602d36f0..dfd05bc494 100644
--- a/core/fpdfapi/render/cpdf_pagerendercache.cpp
+++ b/core/fpdfapi/render/cpdf_pagerendercache.cpp
@@ -13,6 +13,7 @@
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfapi/render/cpdf_imagecacheentry.h"
#include "core/fpdfapi/render/cpdf_renderstatus.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
namespace {
@@ -125,21 +126,15 @@ bool CPDF_PageRenderCache::Continue(PauseIndicatorIface* pPause,
return false;
}
-void CPDF_PageRenderCache::ResetBitmap(const RetainPtr<CPDF_Image>& pImage,
- const RetainPtr<CFX_DIBitmap>& pBitmap) {
+void CPDF_PageRenderCache::ResetBitmap(const RetainPtr<CPDF_Image>& pImage) {
CPDF_ImageCacheEntry* pEntry;
CPDF_Stream* pStream = pImage->GetStream();
const auto it = m_ImageCache.find(pStream);
- if (it == m_ImageCache.end()) {
- if (!pBitmap)
- return;
+ if (it == m_ImageCache.end())
+ return;
- pEntry = new CPDF_ImageCacheEntry(m_pPage->GetDocument(), pImage);
- m_ImageCache[pStream] = pEntry;
- } else {
- pEntry = it->second;
- }
+ pEntry = it->second;
m_nCacheSize -= pEntry->EstimateSize();
- pEntry->Reset(pBitmap);
+ pEntry->Reset(nullptr);
m_nCacheSize += pEntry->EstimateSize();
}
diff --git a/core/fpdfapi/render/cpdf_pagerendercache.h b/core/fpdfapi/render/cpdf_pagerendercache.h
index fe94bed722..8f0cb59414 100644
--- a/core/fpdfapi/render/cpdf_pagerendercache.h
+++ b/core/fpdfapi/render/cpdf_pagerendercache.h
@@ -13,7 +13,6 @@
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/unowned_ptr.h"
-class CFX_DIBitmap;
class CPDF_Image;
class CPDF_ImageCacheEntry;
class CPDF_Page;
@@ -28,8 +27,7 @@ class CPDF_PageRenderCache {
void CacheOptimization(int32_t dwLimitCacheSize);
uint32_t GetTimeCount() const { return m_nTimeCount; }
- void ResetBitmap(const RetainPtr<CPDF_Image>& pImage,
- const RetainPtr<CFX_DIBitmap>& pBitmap);
+ void ResetBitmap(const RetainPtr<CPDF_Image>& pImage);
CPDF_Page* GetPage() const { return m_pPage.Get(); }
CPDF_ImageCacheEntry* GetCurImageCacheEntry() const {
return m_pCurImageCacheEntry;