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

Side by Side Diff: core/src/fpdfapi/fpdf_render/render_int.h

Issue 1539983002: Remove CFX_MapPtrToPtr in CFX_PageRenderCache (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Address review Created 5 years 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 unified diff | Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ 7 #ifndef CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_
8 #define CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ 8 #define CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_
9 9
10 #include <map> 10 #include <map>
11 11
12 #include "core/include/fpdfapi/fpdf_pageobj.h" 12 #include "core/include/fpdfapi/fpdf_pageobj.h"
13 #include "core/include/fpdfapi/fpdf_render.h" 13 #include "core/include/fpdfapi/fpdf_render.h"
14 #include "third_party/base/nonstd_unique_ptr.h" 14 #include "third_party/base/nonstd_unique_ptr.h"
15 15
16 class CFX_GlyphBitmap; 16 class CFX_GlyphBitmap;
17 class CPDF_ImageCache; 17 class CPDF_ImageCacheEntry;
18 class ICodec_ScanlineDecoder; 18 class ICodec_ScanlineDecoder;
19 19
20 #define TYPE3_MAX_BLUES 16 20 #define TYPE3_MAX_BLUES 16
21 21
22 class CPDF_Type3Glyphs { 22 class CPDF_Type3Glyphs {
23 public: 23 public:
24 CPDF_Type3Glyphs() : m_TopBlueCount(0), m_BottomBlueCount(0) {} 24 CPDF_Type3Glyphs() : m_TopBlueCount(0), m_BottomBlueCount(0) {}
25 ~CPDF_Type3Glyphs(); 25 ~CPDF_Type3Glyphs();
26 void AdjustBlue(FX_FLOAT top, 26 void AdjustBlue(FX_FLOAT top,
27 FX_FLOAT bottom, 27 FX_FLOAT bottom,
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 FX_BOOL ProcessImage(CPDF_ImageObject* pImageObj, 179 FX_BOOL ProcessImage(CPDF_ImageObject* pImageObj,
180 const CFX_Matrix* pObj2Device); 180 const CFX_Matrix* pObj2Device);
181 FX_BOOL OutputBitmapAlpha(CPDF_ImageObject* pImageObj, 181 FX_BOOL OutputBitmapAlpha(CPDF_ImageObject* pImageObj,
182 const CFX_Matrix* pImage2Device); 182 const CFX_Matrix* pImage2Device);
183 FX_BOOL OutputImage(CPDF_ImageObject* pImageObj, 183 FX_BOOL OutputImage(CPDF_ImageObject* pImageObj,
184 const CFX_Matrix* pImage2Device); 184 const CFX_Matrix* pImage2Device);
185 FX_BOOL OutputDIBSource(const CFX_DIBSource* pOutputBitmap, 185 FX_BOOL OutputDIBSource(const CFX_DIBSource* pOutputBitmap,
186 FX_ARGB fill_argb, 186 FX_ARGB fill_argb,
187 int bitmap_alpha, 187 int bitmap_alpha,
188 const CFX_Matrix* pImage2Device, 188 const CFX_Matrix* pImage2Device,
189 CPDF_ImageCache* pImageCache, 189 CPDF_ImageCacheEntry* pImageCache,
190 FX_DWORD flags); 190 FX_DWORD flags);
191 void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, 191 void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
192 int left, 192 int left,
193 int top, 193 int top,
194 FX_ARGB mask_argb, 194 FX_ARGB mask_argb,
195 int bitmap_alpha, 195 int bitmap_alpha,
196 int blend_mode, 196 int blend_mode,
197 int bIsolated); 197 int bIsolated);
198 FX_BOOL ProcessShading(CPDF_ShadingObject* pShadingObj, 198 FX_BOOL ProcessShading(CPDF_ShadingObject* pShadingObj,
199 const CFX_Matrix* pObj2Device); 199 const CFX_Matrix* pObj2Device);
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 417
418 private: 418 private:
419 CFX_RenderDevice* m_pDevice; 419 CFX_RenderDevice* m_pDevice;
420 CPDF_RenderContext* m_pContext; 420 CPDF_RenderContext* m_pContext;
421 FX_RECT m_Rect; 421 FX_RECT m_Rect;
422 const CPDF_PageObject* m_pObject; 422 const CPDF_PageObject* m_pObject;
423 nonstd::unique_ptr<CFX_DIBitmap> m_pBitmap; 423 nonstd::unique_ptr<CFX_DIBitmap> m_pBitmap;
424 CFX_Matrix m_Matrix; 424 CFX_Matrix m_Matrix;
425 }; 425 };
426 426
427 class CPDF_ImageCache { 427 class CPDF_ImageCacheEntry {
428 public: 428 public:
429 CPDF_ImageCache(CPDF_Document* pDoc, CPDF_Stream* pStream); 429 CPDF_ImageCacheEntry(CPDF_Document* pDoc, CPDF_Stream* pStream);
430 ~CPDF_ImageCache(); 430 ~CPDF_ImageCacheEntry();
431 void ClearImageData(); 431 void ClearImageData();
432 void Reset(const CFX_DIBitmap* pBitmap); 432 void Reset(const CFX_DIBitmap* pBitmap);
433 FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, 433 FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap,
434 CFX_DIBSource*& pMask, 434 CFX_DIBSource*& pMask,
435 FX_DWORD& MatteColor, 435 FX_DWORD& MatteColor,
436 CPDF_Dictionary* pPageResources, 436 CPDF_Dictionary* pPageResources,
437 FX_BOOL bStdCS = FALSE, 437 FX_BOOL bStdCS = FALSE,
438 FX_DWORD GroupFamily = 0, 438 FX_DWORD GroupFamily = 0,
439 FX_BOOL bLoadMask = FALSE, 439 FX_BOOL bLoadMask = FALSE,
440 CPDF_RenderStatus* pRenderStatus = NULL, 440 CPDF_RenderStatus* pRenderStatus = NULL,
441 int32_t downsampleWidth = 0, 441 int32_t downsampleWidth = 0,
442 int32_t downsampleHeight = 0); 442 int32_t downsampleHeight = 0);
443 FX_DWORD EstimateSize() const { return m_dwCacheSize; } 443 FX_DWORD EstimateSize() const { return m_dwCacheSize; }
444 FX_DWORD GetTimeCount() const { return m_dwTimeCount; } 444 FX_DWORD GetTimeCount() const { return m_dwTimeCount; }
445 CPDF_Stream* GetStream() const { return m_pStream; } 445 CPDF_Stream* GetStream() const { return m_pStream; }
446 void SetTimeCount(FX_DWORD dwTimeCount) { m_dwTimeCount = dwTimeCount; } 446 void SetTimeCount(FX_DWORD dwTimeCount) { m_dwTimeCount = dwTimeCount; }
447 int m_dwTimeCount; 447 int m_dwTimeCount;
448 448
449 public: 449 public:
450 int StartGetCachedBitmap(CPDF_Dictionary* pFormResources, 450 int StartGetCachedBitmap(CPDF_Dictionary* pFormResources,
451 CPDF_Dictionary* pPageResources, 451 CPDF_Dictionary* pPageResources,
452 FX_BOOL bStdCS = FALSE, 452 FX_BOOL bStdCS = FALSE,
453 FX_DWORD GroupFamily = 0, 453 FX_DWORD GroupFamily = 0,
454 FX_BOOL bLoadMask = FALSE, 454 FX_BOOL bLoadMask = FALSE,
455 CPDF_RenderStatus* pRenderStatus = NULL, 455 CPDF_RenderStatus* pRenderStatus = NULL,
456 int32_t downsampleWidth = 0, 456 int32_t downsampleWidth = 0,
457 int32_t downsampleHeight = 0); 457 int32_t downsampleHeight = 0);
458 int Continue(IFX_Pause* pPause); 458 int Continue(IFX_Pause* pPause);
459 int ContinueGetCachedBitmap();
460 CFX_DIBSource* DetachBitmap(); 459 CFX_DIBSource* DetachBitmap();
461 CFX_DIBSource* DetachMask(); 460 CFX_DIBSource* DetachMask();
462 CFX_DIBSource* m_pCurBitmap; 461 CFX_DIBSource* m_pCurBitmap;
463 CFX_DIBSource* m_pCurMask; 462 CFX_DIBSource* m_pCurMask;
464 FX_DWORD m_MatteColor; 463 FX_DWORD m_MatteColor;
465 CPDF_RenderStatus* m_pRenderStatus; 464 CPDF_RenderStatus* m_pRenderStatus;
466 465
467 protected: 466 protected:
467 void ContinueGetCachedBitmap();
468
468 CPDF_Document* m_pDocument; 469 CPDF_Document* m_pDocument;
469 CPDF_Stream* m_pStream; 470 CPDF_Stream* m_pStream;
470 CFX_DIBSource* m_pCachedBitmap; 471 CFX_DIBSource* m_pCachedBitmap;
471 CFX_DIBSource* m_pCachedMask; 472 CFX_DIBSource* m_pCachedMask;
472 FX_DWORD m_dwCacheSize; 473 FX_DWORD m_dwCacheSize;
473 void CalcSize(); 474 void CalcSize();
474 }; 475 };
475 typedef struct { 476 typedef struct {
476 FX_FLOAT m_DecodeMin; 477 FX_FLOAT m_DecodeMin;
477 FX_FLOAT m_DecodeStep; 478 FX_FLOAT m_DecodeStep;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 const uint8_t* m_RampB; 620 const uint8_t* m_RampB;
620 }; 621 };
621 622
622 struct _CPDF_UniqueKeyGen { 623 struct _CPDF_UniqueKeyGen {
623 void Generate(int count, ...); 624 void Generate(int count, ...);
624 FX_CHAR m_Key[128]; 625 FX_CHAR m_Key[128];
625 int m_KeyLen; 626 int m_KeyLen;
626 }; 627 };
627 628
628 #endif // CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ 629 #endif // CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698