| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef CORE_FPDFAPI_FPDF_RENDER_CPDF_PAGERENDERCACHE_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_RENDER_CPDF_PAGERENDERCACHE_H_ |
| 8 #define CORE_FPDFAPI_FPDF_RENDER_CPDF_PAGERENDERCACHE_H_ | 8 #define CORE_FPDFAPI_FPDF_RENDER_CPDF_PAGERENDERCACHE_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 explicit CPDF_PageRenderCache(CPDF_Page* pPage) | 24 explicit CPDF_PageRenderCache(CPDF_Page* pPage) |
| 25 : m_pPage(pPage), | 25 : m_pPage(pPage), |
| 26 m_pCurImageCacheEntry(nullptr), | 26 m_pCurImageCacheEntry(nullptr), |
| 27 m_nTimeCount(0), | 27 m_nTimeCount(0), |
| 28 m_nCacheSize(0), | 28 m_nCacheSize(0), |
| 29 m_bCurFindCache(FALSE) {} | 29 m_bCurFindCache(FALSE) {} |
| 30 ~CPDF_PageRenderCache(); | 30 ~CPDF_PageRenderCache(); |
| 31 void ClearImageData(); | 31 void ClearImageData(); |
| 32 | 32 |
| 33 FX_DWORD EstimateSize(); | 33 uint32_t EstimateSize(); |
| 34 void CacheOptimization(int32_t dwLimitCacheSize); | 34 void CacheOptimization(int32_t dwLimitCacheSize); |
| 35 FX_DWORD GetTimeCount() const { return m_nTimeCount; } | 35 uint32_t GetTimeCount() const { return m_nTimeCount; } |
| 36 void SetTimeCount(FX_DWORD dwTimeCount) { m_nTimeCount = dwTimeCount; } | 36 void SetTimeCount(uint32_t dwTimeCount) { m_nTimeCount = dwTimeCount; } |
| 37 | 37 |
| 38 void GetCachedBitmap(CPDF_Stream* pStream, | 38 void GetCachedBitmap(CPDF_Stream* pStream, |
| 39 CFX_DIBSource*& pBitmap, | 39 CFX_DIBSource*& pBitmap, |
| 40 CFX_DIBSource*& pMask, | 40 CFX_DIBSource*& pMask, |
| 41 FX_DWORD& MatteColor, | 41 uint32_t& MatteColor, |
| 42 FX_BOOL bStdCS = FALSE, | 42 FX_BOOL bStdCS = FALSE, |
| 43 FX_DWORD GroupFamily = 0, | 43 uint32_t GroupFamily = 0, |
| 44 FX_BOOL bLoadMask = FALSE, | 44 FX_BOOL bLoadMask = FALSE, |
| 45 CPDF_RenderStatus* pRenderStatus = NULL, | 45 CPDF_RenderStatus* pRenderStatus = NULL, |
| 46 int32_t downsampleWidth = 0, | 46 int32_t downsampleWidth = 0, |
| 47 int32_t downsampleHeight = 0); | 47 int32_t downsampleHeight = 0); |
| 48 | 48 |
| 49 void ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap); | 49 void ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap); |
| 50 void ClearImageCacheEntry(CPDF_Stream* pStream); | 50 void ClearImageCacheEntry(CPDF_Stream* pStream); |
| 51 CPDF_Page* GetPage() const { return m_pPage; } | 51 CPDF_Page* GetPage() const { return m_pPage; } |
| 52 CPDF_ImageCacheEntry* GetCurImageCacheEntry() const { | 52 CPDF_ImageCacheEntry* GetCurImageCacheEntry() const { |
| 53 return m_pCurImageCacheEntry; | 53 return m_pCurImageCacheEntry; |
| 54 } | 54 } |
| 55 | 55 |
| 56 FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream, | 56 FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream, |
| 57 FX_BOOL bStdCS = FALSE, | 57 FX_BOOL bStdCS = FALSE, |
| 58 FX_DWORD GroupFamily = 0, | 58 uint32_t GroupFamily = 0, |
| 59 FX_BOOL bLoadMask = FALSE, | 59 FX_BOOL bLoadMask = FALSE, |
| 60 CPDF_RenderStatus* pRenderStatus = NULL, | 60 CPDF_RenderStatus* pRenderStatus = NULL, |
| 61 int32_t downsampleWidth = 0, | 61 int32_t downsampleWidth = 0, |
| 62 int32_t downsampleHeight = 0); | 62 int32_t downsampleHeight = 0); |
| 63 | 63 |
| 64 FX_BOOL Continue(IFX_Pause* pPause); | 64 FX_BOOL Continue(IFX_Pause* pPause); |
| 65 | 65 |
| 66 protected: | 66 protected: |
| 67 friend class CPDF_Page; | 67 friend class CPDF_Page; |
| 68 | 68 |
| 69 CPDF_Page* const m_pPage; | 69 CPDF_Page* const m_pPage; |
| 70 CPDF_ImageCacheEntry* m_pCurImageCacheEntry; | 70 CPDF_ImageCacheEntry* m_pCurImageCacheEntry; |
| 71 std::map<CPDF_Stream*, CPDF_ImageCacheEntry*> m_ImageCache; | 71 std::map<CPDF_Stream*, CPDF_ImageCacheEntry*> m_ImageCache; |
| 72 FX_DWORD m_nTimeCount; | 72 uint32_t m_nTimeCount; |
| 73 FX_DWORD m_nCacheSize; | 73 uint32_t m_nCacheSize; |
| 74 FX_BOOL m_bCurFindCache; | 74 FX_BOOL m_bCurFindCache; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 #endif // CORE_FPDFAPI_FPDF_RENDER_CPDF_PAGERENDERCACHE_H_ | 77 #endif // CORE_FPDFAPI_FPDF_RENDER_CPDF_PAGERENDERCACHE_H_ |
| OLD | NEW |