• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 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 XFA_FXFA_CXFA_IMAGERENDERER_H_
8 #define XFA_FXFA_CXFA_IMAGERENDERER_H_
9 
10 #include <memory>
11 
12 #include "core/fxcrt/fx_coordinates.h"
13 #include "core/fxcrt/retain_ptr.h"
14 #include "core/fxcrt/unowned_ptr.h"
15 
16 class CFX_AggImageRenderer;
17 class CFX_DIBitmap;
18 class CFX_RenderDevice;
19 
20 class CXFA_ImageRenderer {
21  public:
22   CXFA_ImageRenderer(CFX_RenderDevice* device,
23                      RetainPtr<CFX_DIBitmap> bitmap,
24                      const CFX_Matrix& image_to_device);
25   ~CXFA_ImageRenderer();
26 
27   // Returns whether to continue or not.
28   bool Start();
29   bool Continue();
30 
31  private:
32   enum class State : bool { kInitial = 0, kStarted };
33 
34   State m_State = State::kInitial;
35   const CFX_Matrix m_ImageMatrix;
36   UnownedPtr<CFX_RenderDevice> const m_pDevice;
37   RetainPtr<CFX_DIBitmap> const m_pBitmap;
38   std::unique_ptr<CFX_AggImageRenderer> m_DeviceHandle;
39 };
40 
41 #endif  // XFA_FXFA_CXFA_IMAGERENDERER_H_
42