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_SCALEDRENDERBUFFER_H_ 8 #define CORE_FPDFAPI_RENDER_CPDF_SCALEDRENDERBUFFER_H_ 9 10 #include <memory> 11 12 #include "core/fxcrt/fx_coordinates.h" 13 #include "core/fxge/cfx_fxgedevice.h" 14 15 class CFX_RenderDevice; 16 class CPDF_PageObject; 17 class CPDF_RenderContext; 18 class CPDF_RenderOptions; 19 20 class CPDF_ScaledRenderBuffer { 21 public: 22 CPDF_ScaledRenderBuffer(); 23 ~CPDF_ScaledRenderBuffer(); 24 25 bool Initialize(CPDF_RenderContext* pContext, 26 CFX_RenderDevice* pDevice, 27 const FX_RECT& pRect, 28 const CPDF_PageObject* pObj, 29 const CPDF_RenderOptions* pOptions, 30 int max_dpi); GetDevice()31 CFX_RenderDevice* GetDevice() { 32 return m_pBitmapDevice ? m_pBitmapDevice.get() : m_pDevice; 33 } GetMatrix()34 CFX_Matrix* GetMatrix() { return &m_Matrix; } 35 void OutputToDevice(); 36 37 private: 38 CFX_RenderDevice* m_pDevice; 39 CPDF_RenderContext* m_pContext; 40 FX_RECT m_Rect; 41 const CPDF_PageObject* m_pObject; 42 std::unique_ptr<CFX_FxgeDevice> m_pBitmapDevice; 43 CFX_Matrix m_Matrix; 44 }; 45 46 #endif // CORE_FPDFAPI_RENDER_CPDF_SCALEDRENDERBUFFER_H_ 47