Chromium Code Reviews| Index: core/include/fpdfapi/fpdf_render.h |
| diff --git a/core/include/fpdfapi/fpdf_render.h b/core/include/fpdfapi/fpdf_render.h |
| index 2460849543f46f79f0c14661a0149d520e334658..e9ec96371ab5a4104069a0dac5260edd725ca227 100644 |
| --- a/core/include/fpdfapi/fpdf_render.h |
| +++ b/core/include/fpdfapi/fpdf_render.h |
| @@ -7,15 +7,17 @@ |
| #ifndef CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ |
| #define CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ |
| +#include <map> |
| + |
| +#include "core/include/fpdfapi/fpdf_page.h" |
| #include "core/include/fxge/fx_ge.h" |
| -#include "fpdf_page.h" |
| #include "third_party/base/nonstd_unique_ptr.h" |
| class CFX_GraphStateData; |
| class CFX_PathData; |
| class CFX_RenderDevice; |
| class CPDF_FormObject; |
| -class CPDF_ImageCache; |
| +class CPDF_ImageCacheEntry; |
| class CPDF_ImageObject; |
| class CPDF_PathObject; |
| class CPDF_QuickStretcher; |
| @@ -215,20 +217,17 @@ class CPDF_TextRenderer { |
| }; |
| class CPDF_PageRenderCache { |
| public: |
| - CPDF_PageRenderCache(CPDF_Page* pPage) { |
| - m_pPage = pPage; |
| - m_nTimeCount = 0; |
| - m_nCacheSize = 0; |
| - m_pCurImageCache = NULL; |
| - m_bCurFindCache = FALSE; |
| - } |
| - ~CPDF_PageRenderCache() { ClearAll(); } |
| - void ClearAll(); |
| + CPDF_PageRenderCache(CPDF_Page* pPage) |
|
Lei Zhang
2015/12/18 22:33:24
explicit?
Tom Sepez
2015/12/18 22:52:36
Done.
|
| + : m_pPage(pPage), |
| + m_pCurImageCacheEntry(nullptr), |
| + m_nTimeCount(0), |
| + m_nCacheSize(0), |
| + m_bCurFindCache(FALSE) {} |
| + ~CPDF_PageRenderCache(); |
| void ClearImageData(); |
| FX_DWORD EstimateSize(); |
| void CacheOptimization(int32_t dwLimitCacheSize); |
| - FX_DWORD GetCachedSize(CPDF_Stream* pStream) const; |
| FX_DWORD GetTimeCount() const { return m_nTimeCount; } |
| void SetTimeCount(FX_DWORD dwTimeCount) { m_nTimeCount = dwTimeCount; } |
| @@ -244,11 +243,12 @@ class CPDF_PageRenderCache { |
| int32_t downsampleHeight = 0); |
| void ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap); |
| - void ClearImageCache(CPDF_Stream* pStream); |
| - CPDF_Page* GetPage() { return m_pPage; } |
| - CFX_MapPtrToPtr m_ImageCaches; |
| + void ClearImageCacheEntry(CPDF_Stream* pStream); |
| + CPDF_Page* GetPage() const { return m_pPage; } |
| + CPDF_ImageCacheEntry* GetCurImageCacheEntry() const { |
| + return m_pCurImageCacheEntry; |
| + } |
| - public: |
| FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream, |
| FX_BOOL bStdCS = FALSE, |
| FX_DWORD GroupFamily = 0, |
| @@ -258,12 +258,12 @@ class CPDF_PageRenderCache { |
| int32_t downsampleHeight = 0); |
| FX_BOOL Continue(IFX_Pause* pPause); |
| - CPDF_ImageCache* m_pCurImageCache; |
| protected: |
| friend class CPDF_Page; |
| - CPDF_Page* m_pPage; |
| - |
| + CPDF_Page* const m_pPage; |
| + CPDF_ImageCacheEntry* m_pCurImageCacheEntry; |
| + std::map<CPDF_Stream*, CPDF_ImageCacheEntry*> m_ImageCache; |
| FX_DWORD m_nTimeCount; |
| FX_DWORD m_nCacheSize; |
| FX_BOOL m_bCurFindCache; |