summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
diff options
context:
space:
mode:
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;