summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_imagecacheentry.h
diff options
context:
space:
mode:
authornpm <npm@chromium.org>2016-12-01 15:37:42 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-01 15:37:42 -0800
commitd7ecb5f272de6cdd88ecef4c7b4d0dbee4355610 (patch)
treead01d3ad2236b4671f8a99f699e25b7d26f84531 /core/fpdfapi/render/cpdf_imagecacheentry.h
parentf78bf1a54a4afb6486869b4bc5850283225d7055 (diff)
downloadpdfium-d7ecb5f272de6cdd88ecef4c7b4d0dbee4355610.tar.xz
Kill off fpdf_render_cache.cppchromium/2939
Review-Url: https://codereview.chromium.org/2550543002
Diffstat (limited to 'core/fpdfapi/render/cpdf_imagecacheentry.h')
-rw-r--r--core/fpdfapi/render/cpdf_imagecacheentry.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/core/fpdfapi/render/cpdf_imagecacheentry.h b/core/fpdfapi/render/cpdf_imagecacheentry.h
new file mode 100644
index 0000000000..e4481e0d73
--- /dev/null
+++ b/core/fpdfapi/render/cpdf_imagecacheentry.h
@@ -0,0 +1,71 @@
+// 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_RENDER_CPDF_IMAGECACHEENTRY_H_
+#define CORE_FPDFAPI_RENDER_CPDF_IMAGECACHEENTRY_H_
+
+#include <memory>
+
+#include "core/fxcrt/fx_system.h"
+
+class CFX_DIBitmap;
+class CFX_DIBSource;
+class CPDF_Dictionary;
+class CPDF_Document;
+class CPDF_RenderStatus;
+class CPDF_Stream;
+class IFX_Pause;
+
+class CPDF_ImageCacheEntry {
+ public:
+ CPDF_ImageCacheEntry(CPDF_Document* pDoc, CPDF_Stream* pStream);
+ ~CPDF_ImageCacheEntry();
+
+ void Reset(const CFX_DIBitmap* pBitmap);
+ bool GetCachedBitmap(CFX_DIBSource*& pBitmap,
+ CFX_DIBSource*& pMask,
+ uint32_t& MatteColor,
+ CPDF_Dictionary* pPageResources,
+ bool bStdCS,
+ uint32_t GroupFamily,
+ bool bLoadMask,
+ CPDF_RenderStatus* pRenderStatus,
+ int32_t downsampleWidth,
+ int32_t downsampleHeight);
+ uint32_t EstimateSize() const { return m_dwCacheSize; }
+ uint32_t GetTimeCount() const { return m_dwTimeCount; }
+ CPDF_Stream* GetStream() const { return m_pStream; }
+
+ int StartGetCachedBitmap(CPDF_Dictionary* pFormResources,
+ CPDF_Dictionary* pPageResources,
+ bool bStdCS,
+ uint32_t GroupFamily,
+ bool bLoadMask,
+ CPDF_RenderStatus* pRenderStatus,
+ int32_t downsampleWidth,
+ int32_t downsampleHeight);
+ int Continue(IFX_Pause* pPause);
+ CFX_DIBSource* DetachBitmap();
+ CFX_DIBSource* DetachMask();
+
+ int m_dwTimeCount;
+ uint32_t m_MatteColor;
+
+ private:
+ void ContinueGetCachedBitmap();
+
+ CPDF_RenderStatus* m_pRenderStatus;
+ CPDF_Document* m_pDocument;
+ CPDF_Stream* m_pStream;
+ CFX_DIBSource* m_pCurBitmap;
+ CFX_DIBSource* m_pCurMask;
+ std::unique_ptr<CFX_DIBSource> m_pCachedBitmap;
+ std::unique_ptr<CFX_DIBSource> m_pCachedMask;
+ uint32_t m_dwCacheSize;
+ void CalcSize();
+};
+
+#endif // CORE_FPDFAPI_RENDER_CPDF_IMAGECACHEENTRY_H_