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

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: Make method protected. 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
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 CPDF_QuickStretcher; 18 class CPDF_QuickStretcher;
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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 438
439 private: 439 private:
440 CFX_RenderDevice* m_pDevice; 440 CFX_RenderDevice* m_pDevice;
441 CPDF_RenderContext* m_pContext; 441 CPDF_RenderContext* m_pContext;
442 FX_RECT m_Rect; 442 FX_RECT m_Rect;
443 const CPDF_PageObject* m_pObject; 443 const CPDF_PageObject* m_pObject;
444 nonstd::unique_ptr<CFX_DIBitmap> m_pBitmap; 444 nonstd::unique_ptr<CFX_DIBitmap> m_pBitmap;
445 CFX_Matrix m_Matrix; 445 CFX_Matrix m_Matrix;
446 }; 446 };
447 447
448 class CPDF_ImageCache { 448 class CPDF_ImageCacheEntry {
449 public: 449 public:
450 CPDF_ImageCache(CPDF_Document* pDoc, CPDF_Stream* pStream); 450 CPDF_ImageCacheEntry(CPDF_Document* pDoc, CPDF_Stream* pStream);
451 ~CPDF_ImageCache(); 451 ~CPDF_ImageCacheEntry();
452 void ClearImageData(); 452 void ClearImageData();
453 void Reset(const CFX_DIBitmap* pBitmap); 453 void Reset(const CFX_DIBitmap* pBitmap);
454 FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, 454 FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap,
455 CFX_DIBSource*& pMask, 455 CFX_DIBSource*& pMask,
456 FX_DWORD& MatteColor, 456 FX_DWORD& MatteColor,
457 CPDF_Dictionary* pPageResources, 457 CPDF_Dictionary* pPageResources,
458 FX_BOOL bStdCS = FALSE, 458 FX_BOOL bStdCS = FALSE,
459 FX_DWORD GroupFamily = 0, 459 FX_DWORD GroupFamily = 0,
460 FX_BOOL bLoadMask = FALSE, 460 FX_BOOL bLoadMask = FALSE,
461 CPDF_RenderStatus* pRenderStatus = NULL, 461 CPDF_RenderStatus* pRenderStatus = NULL,
462 int32_t downsampleWidth = 0, 462 int32_t downsampleWidth = 0,
463 int32_t downsampleHeight = 0); 463 int32_t downsampleHeight = 0);
464 FX_DWORD EstimateSize() const { return m_dwCacheSize; } 464 FX_DWORD EstimateSize() const { return m_dwCacheSize; }
465 FX_DWORD GetTimeCount() const { return m_dwTimeCount; } 465 FX_DWORD GetTimeCount() const { return m_dwTimeCount; }
466 CPDF_Stream* GetStream() const { return m_pStream; } 466 CPDF_Stream* GetStream() const { return m_pStream; }
467 void SetTimeCount(FX_DWORD dwTimeCount) { m_dwTimeCount = dwTimeCount; } 467 void SetTimeCount(FX_DWORD dwTimeCount) { m_dwTimeCount = dwTimeCount; }
468 int m_dwTimeCount; 468 int m_dwTimeCount;
469 469
470 public: 470 public:
471 int StartGetCachedBitmap(CPDF_Dictionary* pFormResources, 471 int StartGetCachedBitmap(CPDF_Dictionary* pFormResources,
472 CPDF_Dictionary* pPageResources, 472 CPDF_Dictionary* pPageResources,
473 FX_BOOL bStdCS = FALSE, 473 FX_BOOL bStdCS = FALSE,
474 FX_DWORD GroupFamily = 0, 474 FX_DWORD GroupFamily = 0,
475 FX_BOOL bLoadMask = FALSE, 475 FX_BOOL bLoadMask = FALSE,
476 CPDF_RenderStatus* pRenderStatus = NULL, 476 CPDF_RenderStatus* pRenderStatus = NULL,
477 int32_t downsampleWidth = 0, 477 int32_t downsampleWidth = 0,
478 int32_t downsampleHeight = 0); 478 int32_t downsampleHeight = 0);
479 int Continue(IFX_Pause* pPause); 479 int Continue(IFX_Pause* pPause);
480 int ContinueGetCachedBitmap();
481 CFX_DIBSource* DetachBitmap(); 480 CFX_DIBSource* DetachBitmap();
482 CFX_DIBSource* DetachMask(); 481 CFX_DIBSource* DetachMask();
483 CFX_DIBSource* m_pCurBitmap; 482 CFX_DIBSource* m_pCurBitmap;
484 CFX_DIBSource* m_pCurMask; 483 CFX_DIBSource* m_pCurMask;
485 FX_DWORD m_MatteColor; 484 FX_DWORD m_MatteColor;
486 CPDF_RenderStatus* m_pRenderStatus; 485 CPDF_RenderStatus* m_pRenderStatus;
487 486
488 protected: 487 protected:
488 void ContinueGetCachedBitmap();
489
489 CPDF_Document* m_pDocument; 490 CPDF_Document* m_pDocument;
490 CPDF_Stream* m_pStream; 491 CPDF_Stream* m_pStream;
491 CFX_DIBSource* m_pCachedBitmap; 492 CFX_DIBSource* m_pCachedBitmap;
492 CFX_DIBSource* m_pCachedMask; 493 CFX_DIBSource* m_pCachedMask;
493 FX_DWORD m_dwCacheSize; 494 FX_DWORD m_dwCacheSize;
494 void CalcSize(); 495 void CalcSize();
495 }; 496 };
496 typedef struct { 497 typedef struct {
497 FX_FLOAT m_DecodeMin; 498 FX_FLOAT m_DecodeMin;
498 FX_FLOAT m_DecodeStep; 499 FX_FLOAT m_DecodeStep;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 const uint8_t* m_RampB; 641 const uint8_t* m_RampB;
641 }; 642 };
642 643
643 struct _CPDF_UniqueKeyGen { 644 struct _CPDF_UniqueKeyGen {
644 void Generate(int count, ...); 645 void Generate(int count, ...);
645 FX_CHAR m_Key[128]; 646 FX_CHAR m_Key[128];
646 int m_KeyLen; 647 int m_KeyLen;
647 }; 648 };
648 649
649 #endif // CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ 650 #endif // CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698