OLD | NEW |
---|---|
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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_INCLUDE_FPDFAPI_FPDF_RENDER_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ |
8 #define CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ | 8 #define CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ |
9 | 9 |
10 #include <map> | |
11 | |
12 #include "core/include/fpdfapi/fpdf_page.h" | |
10 #include "core/include/fxge/fx_ge.h" | 13 #include "core/include/fxge/fx_ge.h" |
11 #include "fpdf_page.h" | |
12 #include "third_party/base/nonstd_unique_ptr.h" | 14 #include "third_party/base/nonstd_unique_ptr.h" |
13 | 15 |
14 class CFX_GraphStateData; | 16 class CFX_GraphStateData; |
15 class CFX_PathData; | 17 class CFX_PathData; |
16 class CFX_RenderDevice; | 18 class CFX_RenderDevice; |
17 class CPDF_FormObject; | 19 class CPDF_FormObject; |
18 class CPDF_ImageCache; | 20 class CPDF_ImageCacheEntry; |
19 class CPDF_ImageObject; | 21 class CPDF_ImageObject; |
20 class CPDF_PathObject; | 22 class CPDF_PathObject; |
21 class CPDF_QuickStretcher; | 23 class CPDF_QuickStretcher; |
22 class CPDF_RenderContext; | 24 class CPDF_RenderContext; |
23 class CPDF_RenderOptions; | 25 class CPDF_RenderOptions; |
24 class CPDF_RenderStatus; | 26 class CPDF_RenderStatus; |
25 class CPDF_ShadingObject; | 27 class CPDF_ShadingObject; |
26 class CPDF_TextObject; | 28 class CPDF_TextObject; |
27 class IFX_Pause; | 29 class IFX_Pause; |
28 | 30 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 int nChars, | 210 int nChars, |
209 FX_DWORD* pCharCodes, | 211 FX_DWORD* pCharCodes, |
210 FX_FLOAT* pCharPos, | 212 FX_FLOAT* pCharPos, |
211 CPDF_Font* pFont, | 213 CPDF_Font* pFont, |
212 FX_FLOAT font_size, | 214 FX_FLOAT font_size, |
213 const CFX_Matrix* pText2Device, | 215 const CFX_Matrix* pText2Device, |
214 FX_ARGB fill_argb); | 216 FX_ARGB fill_argb); |
215 }; | 217 }; |
216 class CPDF_PageRenderCache { | 218 class CPDF_PageRenderCache { |
217 public: | 219 public: |
218 CPDF_PageRenderCache(CPDF_Page* pPage) { | 220 CPDF_PageRenderCache(CPDF_Page* pPage) |
Lei Zhang
2015/12/18 22:33:24
explicit?
Tom Sepez
2015/12/18 22:52:36
Done.
| |
219 m_pPage = pPage; | 221 : m_pPage(pPage), |
220 m_nTimeCount = 0; | 222 m_pCurImageCacheEntry(nullptr), |
221 m_nCacheSize = 0; | 223 m_nTimeCount(0), |
222 m_pCurImageCache = NULL; | 224 m_nCacheSize(0), |
223 m_bCurFindCache = FALSE; | 225 m_bCurFindCache(FALSE) {} |
224 } | 226 ~CPDF_PageRenderCache(); |
225 ~CPDF_PageRenderCache() { ClearAll(); } | |
226 void ClearAll(); | |
227 void ClearImageData(); | 227 void ClearImageData(); |
228 | 228 |
229 FX_DWORD EstimateSize(); | 229 FX_DWORD EstimateSize(); |
230 void CacheOptimization(int32_t dwLimitCacheSize); | 230 void CacheOptimization(int32_t dwLimitCacheSize); |
231 FX_DWORD GetCachedSize(CPDF_Stream* pStream) const; | |
232 FX_DWORD GetTimeCount() const { return m_nTimeCount; } | 231 FX_DWORD GetTimeCount() const { return m_nTimeCount; } |
233 void SetTimeCount(FX_DWORD dwTimeCount) { m_nTimeCount = dwTimeCount; } | 232 void SetTimeCount(FX_DWORD dwTimeCount) { m_nTimeCount = dwTimeCount; } |
234 | 233 |
235 void GetCachedBitmap(CPDF_Stream* pStream, | 234 void GetCachedBitmap(CPDF_Stream* pStream, |
236 CFX_DIBSource*& pBitmap, | 235 CFX_DIBSource*& pBitmap, |
237 CFX_DIBSource*& pMask, | 236 CFX_DIBSource*& pMask, |
238 FX_DWORD& MatteColor, | 237 FX_DWORD& MatteColor, |
239 FX_BOOL bStdCS = FALSE, | 238 FX_BOOL bStdCS = FALSE, |
240 FX_DWORD GroupFamily = 0, | 239 FX_DWORD GroupFamily = 0, |
241 FX_BOOL bLoadMask = FALSE, | 240 FX_BOOL bLoadMask = FALSE, |
242 CPDF_RenderStatus* pRenderStatus = NULL, | 241 CPDF_RenderStatus* pRenderStatus = NULL, |
243 int32_t downsampleWidth = 0, | 242 int32_t downsampleWidth = 0, |
244 int32_t downsampleHeight = 0); | 243 int32_t downsampleHeight = 0); |
245 | 244 |
246 void ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap); | 245 void ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap); |
247 void ClearImageCache(CPDF_Stream* pStream); | 246 void ClearImageCacheEntry(CPDF_Stream* pStream); |
248 CPDF_Page* GetPage() { return m_pPage; } | 247 CPDF_Page* GetPage() const { return m_pPage; } |
249 CFX_MapPtrToPtr m_ImageCaches; | 248 CPDF_ImageCacheEntry* GetCurImageCacheEntry() const { |
249 return m_pCurImageCacheEntry; | |
250 } | |
250 | 251 |
251 public: | |
252 FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream, | 252 FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream, |
253 FX_BOOL bStdCS = FALSE, | 253 FX_BOOL bStdCS = FALSE, |
254 FX_DWORD GroupFamily = 0, | 254 FX_DWORD GroupFamily = 0, |
255 FX_BOOL bLoadMask = FALSE, | 255 FX_BOOL bLoadMask = FALSE, |
256 CPDF_RenderStatus* pRenderStatus = NULL, | 256 CPDF_RenderStatus* pRenderStatus = NULL, |
257 int32_t downsampleWidth = 0, | 257 int32_t downsampleWidth = 0, |
258 int32_t downsampleHeight = 0); | 258 int32_t downsampleHeight = 0); |
259 | 259 |
260 FX_BOOL Continue(IFX_Pause* pPause); | 260 FX_BOOL Continue(IFX_Pause* pPause); |
261 CPDF_ImageCache* m_pCurImageCache; | |
262 | 261 |
263 protected: | 262 protected: |
264 friend class CPDF_Page; | 263 friend class CPDF_Page; |
265 CPDF_Page* m_pPage; | 264 CPDF_Page* const m_pPage; |
266 | 265 CPDF_ImageCacheEntry* m_pCurImageCacheEntry; |
266 std::map<CPDF_Stream*, CPDF_ImageCacheEntry*> m_ImageCache; | |
267 FX_DWORD m_nTimeCount; | 267 FX_DWORD m_nTimeCount; |
268 FX_DWORD m_nCacheSize; | 268 FX_DWORD m_nCacheSize; |
269 FX_BOOL m_bCurFindCache; | 269 FX_BOOL m_bCurFindCache; |
270 }; | 270 }; |
271 class CPDF_RenderConfig { | 271 class CPDF_RenderConfig { |
272 public: | 272 public: |
273 CPDF_RenderConfig(); | 273 CPDF_RenderConfig(); |
274 ~CPDF_RenderConfig(); | 274 ~CPDF_RenderConfig(); |
275 int m_HalftoneLimit; | 275 int m_HalftoneLimit; |
276 int m_RenderStepLimit; | 276 int m_RenderStepLimit; |
277 }; | 277 }; |
278 | 278 |
279 FX_BOOL IsAvailableMatrix(const CFX_Matrix& matrix); | 279 FX_BOOL IsAvailableMatrix(const CFX_Matrix& matrix); |
280 | 280 |
281 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ | 281 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ |
OLD | NEW |