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_PAGERENDERCONTEXT_H_
8 #define CORE_FPDFAPI_RENDER_CPDF_PAGERENDERCONTEXT_H_
9 
10 #include <memory>
11 
12 #include "core/fpdfapi/page/cpdf_page.h"
13 
14 class CFX_RenderDevice;
15 class CPDF_ProgressiveRenderer;
16 class CPDF_RenderContext;
17 class CPDF_RenderOptions;
18 
19 // Everything about rendering is put here: for OOM recovery
20 class CPDF_PageRenderContext final : public CPDF_Page::RenderContextIface {
21  public:
22   // Context merely manages the lifetime for callers.
23   class AnnotListIface {
24    public:
~AnnotListIface()25     virtual ~AnnotListIface() {}
26   };
27 
28   CPDF_PageRenderContext();
29   ~CPDF_PageRenderContext() override;
30 
31   // Specific destruction order required.
32   std::unique_ptr<AnnotListIface> m_pAnnots;
33   std::unique_ptr<CPDF_RenderOptions> m_pOptions;
34   std::unique_ptr<CFX_RenderDevice> m_pDevice;
35   std::unique_ptr<CPDF_RenderContext> m_pContext;
36   std::unique_ptr<CPDF_ProgressiveRenderer> m_pRenderer;
37 };
38 
39 #endif  // CORE_FPDFAPI_RENDER_CPDF_PAGERENDERCONTEXT_H_
40