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