| 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_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 #include <memory> |
| 11 | 12 |
| 12 #include "core/include/fpdfapi/fpdf_pageobj.h" | 13 #include "core/include/fpdfapi/fpdf_pageobj.h" |
| 13 #include "core/include/fpdfapi/fpdf_render.h" | 14 #include "core/include/fpdfapi/fpdf_render.h" |
| 14 #include "third_party/base/nonstd_unique_ptr.h" | |
| 15 | 15 |
| 16 class CFX_GlyphBitmap; | 16 class CFX_GlyphBitmap; |
| 17 class CFX_ImageTransformer; | 17 class CFX_ImageTransformer; |
| 18 class CPDF_ImageCacheEntry; | 18 class CPDF_ImageCacheEntry; |
| 19 class CPDF_ImageLoaderHandle; | 19 class CPDF_ImageLoaderHandle; |
| 20 class ICodec_ScanlineDecoder; | 20 class ICodec_ScanlineDecoder; |
| 21 | 21 |
| 22 #define TYPE3_MAX_BLUES 16 | 22 #define TYPE3_MAX_BLUES 16 |
| 23 | 23 |
| 24 class CPDF_Type3Glyphs { | 24 class CPDF_Type3Glyphs { |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 static const int kRenderMaxRecursionDepth = 64; | 247 static const int kRenderMaxRecursionDepth = 64; |
| 248 static int s_CurrentRecursionDepth; | 248 static int s_CurrentRecursionDepth; |
| 249 | 249 |
| 250 CFX_RenderDevice* m_pDevice; | 250 CFX_RenderDevice* m_pDevice; |
| 251 CFX_Matrix m_DeviceMatrix; | 251 CFX_Matrix m_DeviceMatrix; |
| 252 CPDF_ClipPath m_LastClipPath; | 252 CPDF_ClipPath m_LastClipPath; |
| 253 const CPDF_PageObject* m_pCurObj; | 253 const CPDF_PageObject* m_pCurObj; |
| 254 const CPDF_PageObject* m_pStopObj; | 254 const CPDF_PageObject* m_pStopObj; |
| 255 CPDF_GraphicStates m_InitialStates; | 255 CPDF_GraphicStates m_InitialStates; |
| 256 int m_HalftoneLimit; | 256 int m_HalftoneLimit; |
| 257 nonstd::unique_ptr<IPDF_ObjectRenderer> m_pObjectRenderer; | 257 std::unique_ptr<IPDF_ObjectRenderer> m_pObjectRenderer; |
| 258 FX_BOOL m_bPrint; | 258 FX_BOOL m_bPrint; |
| 259 int m_Transparency; | 259 int m_Transparency; |
| 260 int m_DitherBits; | 260 int m_DitherBits; |
| 261 FX_BOOL m_bDropObjects; | 261 FX_BOOL m_bDropObjects; |
| 262 FX_BOOL m_bStdCS; | 262 FX_BOOL m_bStdCS; |
| 263 FX_DWORD m_GroupFamily; | 263 FX_DWORD m_GroupFamily; |
| 264 FX_BOOL m_bLoadMask; | 264 FX_BOOL m_bLoadMask; |
| 265 CPDF_Type3Char* m_pType3Char; | 265 CPDF_Type3Char* m_pType3Char; |
| 266 FX_ARGB m_T3FillColor; | 266 FX_ARGB m_T3FillColor; |
| 267 int m_curBlend; | 267 int m_curBlend; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 return m_pBitmapDevice ? m_pBitmapDevice.get() : m_pDevice; | 385 return m_pBitmapDevice ? m_pBitmapDevice.get() : m_pDevice; |
| 386 } | 386 } |
| 387 CFX_Matrix* GetMatrix() { return &m_Matrix; } | 387 CFX_Matrix* GetMatrix() { return &m_Matrix; } |
| 388 void OutputToDevice(); | 388 void OutputToDevice(); |
| 389 | 389 |
| 390 private: | 390 private: |
| 391 CFX_RenderDevice* m_pDevice; | 391 CFX_RenderDevice* m_pDevice; |
| 392 CPDF_RenderContext* m_pContext; | 392 CPDF_RenderContext* m_pContext; |
| 393 FX_RECT m_Rect; | 393 FX_RECT m_Rect; |
| 394 const CPDF_PageObject* m_pObject; | 394 const CPDF_PageObject* m_pObject; |
| 395 nonstd::unique_ptr<CFX_FxgeDevice> m_pBitmapDevice; | 395 std::unique_ptr<CFX_FxgeDevice> m_pBitmapDevice; |
| 396 CFX_Matrix m_Matrix; | 396 CFX_Matrix m_Matrix; |
| 397 }; | 397 }; |
| 398 | 398 |
| 399 class CPDF_DeviceBuffer { | 399 class CPDF_DeviceBuffer { |
| 400 public: | 400 public: |
| 401 CPDF_DeviceBuffer(); | 401 CPDF_DeviceBuffer(); |
| 402 ~CPDF_DeviceBuffer(); | 402 ~CPDF_DeviceBuffer(); |
| 403 FX_BOOL Initialize(CPDF_RenderContext* pContext, | 403 FX_BOOL Initialize(CPDF_RenderContext* pContext, |
| 404 CFX_RenderDevice* pDevice, | 404 CFX_RenderDevice* pDevice, |
| 405 FX_RECT* pRect, | 405 FX_RECT* pRect, |
| 406 const CPDF_PageObject* pObj, | 406 const CPDF_PageObject* pObj, |
| 407 int max_dpi = 0); | 407 int max_dpi = 0); |
| 408 void OutputToDevice(); | 408 void OutputToDevice(); |
| 409 CFX_DIBitmap* GetBitmap() const { return m_pBitmap.get(); } | 409 CFX_DIBitmap* GetBitmap() const { return m_pBitmap.get(); } |
| 410 const CFX_Matrix* GetMatrix() const { return &m_Matrix; } | 410 const CFX_Matrix* GetMatrix() const { return &m_Matrix; } |
| 411 | 411 |
| 412 private: | 412 private: |
| 413 CFX_RenderDevice* m_pDevice; | 413 CFX_RenderDevice* m_pDevice; |
| 414 CPDF_RenderContext* m_pContext; | 414 CPDF_RenderContext* m_pContext; |
| 415 FX_RECT m_Rect; | 415 FX_RECT m_Rect; |
| 416 const CPDF_PageObject* m_pObject; | 416 const CPDF_PageObject* m_pObject; |
| 417 nonstd::unique_ptr<CFX_DIBitmap> m_pBitmap; | 417 std::unique_ptr<CFX_DIBitmap> m_pBitmap; |
| 418 CFX_Matrix m_Matrix; | 418 CFX_Matrix m_Matrix; |
| 419 }; | 419 }; |
| 420 | 420 |
| 421 class CPDF_ImageCacheEntry { | 421 class CPDF_ImageCacheEntry { |
| 422 public: | 422 public: |
| 423 CPDF_ImageCacheEntry(CPDF_Document* pDoc, CPDF_Stream* pStream); | 423 CPDF_ImageCacheEntry(CPDF_Document* pDoc, CPDF_Stream* pStream); |
| 424 ~CPDF_ImageCacheEntry(); | 424 ~CPDF_ImageCacheEntry(); |
| 425 void ClearImageData(); | 425 void ClearImageData(); |
| 426 void Reset(const CFX_DIBitmap* pBitmap); | 426 void Reset(const CFX_DIBitmap* pBitmap); |
| 427 FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, | 427 FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 FX_DWORD m_nComponents; | 582 FX_DWORD m_nComponents; |
| 583 FX_DWORD m_GroupFamily; | 583 FX_DWORD m_GroupFamily; |
| 584 FX_BOOL m_bLoadMask; | 584 FX_BOOL m_bLoadMask; |
| 585 FX_BOOL m_bDefaultDecode; | 585 FX_BOOL m_bDefaultDecode; |
| 586 FX_BOOL m_bImageMask; | 586 FX_BOOL m_bImageMask; |
| 587 FX_BOOL m_bDoBpcCheck; | 587 FX_BOOL m_bDoBpcCheck; |
| 588 FX_BOOL m_bColorKey; | 588 FX_BOOL m_bColorKey; |
| 589 DIB_COMP_DATA* m_pCompData; | 589 DIB_COMP_DATA* m_pCompData; |
| 590 uint8_t* m_pLineBuf; | 590 uint8_t* m_pLineBuf; |
| 591 uint8_t* m_pMaskedLine; | 591 uint8_t* m_pMaskedLine; |
| 592 nonstd::unique_ptr<CFX_DIBitmap> m_pCachedBitmap; | 592 std::unique_ptr<CFX_DIBitmap> m_pCachedBitmap; |
| 593 ICodec_ScanlineDecoder* m_pDecoder; | 593 ICodec_ScanlineDecoder* m_pDecoder; |
| 594 }; | 594 }; |
| 595 | 595 |
| 596 #define FPDF_HUGE_IMAGE_SIZE 60000000 | 596 #define FPDF_HUGE_IMAGE_SIZE 60000000 |
| 597 class CPDF_DIBTransferFunc : public CFX_FilteredDIB { | 597 class CPDF_DIBTransferFunc : public CFX_FilteredDIB { |
| 598 public: | 598 public: |
| 599 CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFunc); | 599 CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFunc); |
| 600 ~CPDF_DIBTransferFunc() override; | 600 ~CPDF_DIBTransferFunc() override; |
| 601 | 601 |
| 602 // CFX_FilteredDIB | 602 // CFX_FilteredDIB |
| (...skipping 11 matching lines...) Expand all Loading... |
| 614 const uint8_t* m_RampB; | 614 const uint8_t* m_RampB; |
| 615 }; | 615 }; |
| 616 | 616 |
| 617 struct _CPDF_UniqueKeyGen { | 617 struct _CPDF_UniqueKeyGen { |
| 618 void Generate(int count, ...); | 618 void Generate(int count, ...); |
| 619 FX_CHAR m_Key[128]; | 619 FX_CHAR m_Key[128]; |
| 620 int m_KeyLen; | 620 int m_KeyLen; |
| 621 }; | 621 }; |
| 622 | 622 |
| 623 #endif // CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ | 623 #endif // CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ |
| OLD | NEW |