1 // Copyright 2016 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FPDFAPI_RENDER_CPDF_DEVICEBUFFER_H_ 8 #define CORE_FPDFAPI_RENDER_CPDF_DEVICEBUFFER_H_ 9 10 #include <memory> 11 12 #include "core/fxcrt/fx_coordinates.h" 13 14 class CFX_DIBitmap; 15 class CFX_RenderDevice; 16 class CPDF_PageObject; 17 class CPDF_RenderContext; 18 19 class CPDF_DeviceBuffer { 20 public: 21 CPDF_DeviceBuffer(); 22 ~CPDF_DeviceBuffer(); 23 bool Initialize(CPDF_RenderContext* pContext, 24 CFX_RenderDevice* pDevice, 25 FX_RECT* pRect, 26 const CPDF_PageObject* pObj, 27 int max_dpi); 28 void OutputToDevice(); GetBitmap()29 CFX_DIBitmap* GetBitmap() const { return m_pBitmap.get(); } GetMatrix()30 const CFX_Matrix* GetMatrix() const { return &m_Matrix; } 31 32 private: 33 CFX_RenderDevice* m_pDevice; 34 CPDF_RenderContext* m_pContext; 35 FX_RECT m_Rect; 36 const CPDF_PageObject* m_pObject; 37 std::unique_ptr<CFX_DIBitmap> m_pBitmap; 38 CFX_Matrix m_Matrix; 39 }; 40 41 #endif // CORE_FPDFAPI_RENDER_CPDF_DEVICEBUFFER_H_ 42