diff options
author | thestig <thestig@chromium.org> | 2016-04-05 15:53:32 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-05 15:53:32 -0700 |
commit | 54750b570d32898c8ebd4fa59105bfd3b96043af (patch) | |
tree | 25ffed24af8fba5f2bc76266c74335f6b92c63eb /core/fpdfapi | |
parent | e5984e92ff378a86118f1e6428dc325dbde9c409 (diff) | |
download | pdfium-54750b570d32898c8ebd4fa59105bfd3b96043af.tar.xz |
Remove dead image decoding/caching code.
Review URL: https://codereview.chromium.org/1860223002
Diffstat (limited to 'core/fpdfapi')
-rw-r--r-- | core/fpdfapi/fpdf_render/cpdf_pagerendercache.h | 1 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_render/fpdf_render_cache.cpp | 10 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 14 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_render/render_int.h | 4 |
4 files changed, 2 insertions, 27 deletions
diff --git a/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h b/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h index 4e47e019b4..4f9ea1fe46 100644 --- a/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h +++ b/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h @@ -28,7 +28,6 @@ class CPDF_PageRenderCache { m_nCacheSize(0), m_bCurFindCache(FALSE) {} ~CPDF_PageRenderCache(); - void ClearImageData(); uint32_t EstimateSize(); void CacheOptimization(int32_t dwLimitCacheSize); diff --git a/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp index f5bc584348..a2592004e7 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp @@ -188,15 +188,7 @@ void CPDF_ImageCacheEntry::Reset(const CFX_DIBitmap* pBitmap) { } CalcSize(); } -void CPDF_PageRenderCache::ClearImageData() { - for (const auto& it : m_ImageCache) - it.second->ClearImageData(); -} -void CPDF_ImageCacheEntry::ClearImageData() { - if (m_pCachedBitmap && !m_pCachedBitmap->GetBuffer()) { - ((CPDF_DIBSource*)m_pCachedBitmap)->ClearImageData(); - } -} + static uint32_t FPDF_ImageCache_EstimateImageSize(const CFX_DIBSource* pDIB) { return pDIB && pDIB->GetBuffer() ? (uint32_t)pDIB->GetHeight() * pDIB->GetPitch() + diff --git a/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index 144de779e9..7a4a36e1cf 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -1474,20 +1474,6 @@ FX_BOOL CPDF_DIBSource::TransMask() const { m_Family == PDFCS_DEVICECMYK; } -void CPDF_DIBSource::SetDownSampleSize(int dest_width, int dest_height) { - if (m_pDecoder) { - m_pDecoder->DownScale(dest_width, dest_height); - m_Width = m_pDecoder->GetWidth(); - m_Height = m_pDecoder->GetHeight(); - } -} - -void CPDF_DIBSource::ClearImageData() { - if (m_pDecoder) { - m_pDecoder->ClearImageData(); - } -} - CPDF_ImageLoaderHandle::CPDF_ImageLoaderHandle() { m_pImageLoader = nullptr; m_pCache = nullptr; diff --git a/core/fpdfapi/fpdf_render/render_int.h b/core/fpdfapi/fpdf_render/render_int.h index b22b9fc39b..eab6c9ff21 100644 --- a/core/fpdfapi/fpdf_render/render_int.h +++ b/core/fpdfapi/fpdf_render/render_int.h @@ -443,7 +443,7 @@ class CPDF_ImageCacheEntry { public: CPDF_ImageCacheEntry(CPDF_Document* pDoc, CPDF_Stream* pStream); ~CPDF_ImageCacheEntry(); - void ClearImageData(); + void Reset(const CFX_DIBitmap* pBitmap); FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, @@ -521,11 +521,9 @@ class CPDF_DIBSource : public CFX_DIBSource { FX_BOOL bFlipX, int clip_left, int clip_width) const override; - void SetDownSampleSize(int dest_width, int dest_height) override; CFX_DIBitmap* GetBitmap() const; void ReleaseBitmap(CFX_DIBitmap* pBitmap) const; - void ClearImageData(); uint32_t GetMatteColor() const { return m_MatteColor; } int StartLoadDIBSource(CPDF_Document* pDoc, |