1 // Copyright 2016 The PDFium Authors 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(CFX_RenderDevice* device, const FX_RECT& rect); 24 ~CPDF_ScaledRenderBuffer(); 25 26 bool Initialize(CPDF_RenderContext* pContext, 27 const CPDF_PageObject* pObj, 28 const CPDF_RenderOptions& options, 29 int max_dpi); 30 31 CFX_DefaultRenderDevice* GetDevice(); GetMatrix()32 const CFX_Matrix& GetMatrix() const { return matrix_; } 33 void OutputToDevice(); 34 35 private: 36 UnownedPtr<CFX_RenderDevice> const device_; 37 std::unique_ptr<CFX_DefaultRenderDevice> const bitmap_device_; 38 const FX_RECT rect_; 39 CFX_Matrix matrix_; 40 }; 41 42 #endif // CORE_FPDFAPI_RENDER_CPDF_SCALEDRENDERBUFFER_H_ 43