Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(856)

Unified Diff: core/fpdfapi/fpdf_render/cpdf_pagerendercache.h

Issue 1805603002: core/include/fdpfapi cleanup Part I. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_parser/ipdf_security_handler.h ('k') | core/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_render/cpdf_pagerendercache.h
diff --git a/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h b/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h
new file mode 100644
index 0000000000000000000000000000000000000000..26d71efcaba5db923959b2183a3701f2b99dc3f4
--- /dev/null
+++ b/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h
@@ -0,0 +1,77 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FPDFAPI_FPDF_RENDER_CPDF_PAGERENDERCACHE_H_
+#define CORE_FPDFAPI_FPDF_RENDER_CPDF_PAGERENDERCACHE_H_
+
+#include <map>
+
+#include "core/include/fxcrt/fx_system.h"
+
+class CPDF_Stream;
+class CPDF_ImageCacheEntry;
+class CPDF_Page;
+class CPDF_RenderStatus;
+class CFX_DIBitmap;
+class CFX_DIBSource;
+class IFX_Pause;
+
+class CPDF_PageRenderCache {
+ public:
+ explicit CPDF_PageRenderCache(CPDF_Page* pPage)
+ : 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 GetTimeCount() const { return m_nTimeCount; }
+ void SetTimeCount(FX_DWORD dwTimeCount) { m_nTimeCount = dwTimeCount; }
+
+ void GetCachedBitmap(CPDF_Stream* pStream,
+ CFX_DIBSource*& pBitmap,
+ CFX_DIBSource*& pMask,
+ FX_DWORD& MatteColor,
+ FX_BOOL bStdCS = FALSE,
+ FX_DWORD GroupFamily = 0,
+ FX_BOOL bLoadMask = FALSE,
+ CPDF_RenderStatus* pRenderStatus = NULL,
+ int32_t downsampleWidth = 0,
+ int32_t downsampleHeight = 0);
+
+ void ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap);
+ void ClearImageCacheEntry(CPDF_Stream* pStream);
+ CPDF_Page* GetPage() const { return m_pPage; }
+ CPDF_ImageCacheEntry* GetCurImageCacheEntry() const {
+ return m_pCurImageCacheEntry;
+ }
+
+ FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream,
+ FX_BOOL bStdCS = FALSE,
+ FX_DWORD GroupFamily = 0,
+ FX_BOOL bLoadMask = FALSE,
+ CPDF_RenderStatus* pRenderStatus = NULL,
+ int32_t downsampleWidth = 0,
+ int32_t downsampleHeight = 0);
+
+ FX_BOOL Continue(IFX_Pause* pPause);
+
+ protected:
+ friend class CPDF_Page;
+
+ 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;
+};
+
+#endif // CORE_FPDFAPI_FPDF_RENDER_CPDF_PAGERENDERCACHE_H_
« no previous file with comments | « core/fpdfapi/fpdf_parser/ipdf_security_handler.h ('k') | core/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698