OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FDE_FDE_RENDER_H_ | 7 #ifndef XFA_FDE_FDE_RENDER_H_ |
8 #define XFA_FDE_FDE_RENDER_H_ | 8 #define XFA_FDE_FDE_RENDER_H_ |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "core/fxcrt/include/fx_coordinates.h" | 12 #include "core/fxcrt/include/fx_coordinates.h" |
11 #include "xfa/fde/fde_gedevice.h" | 13 #include "xfa/fde/fde_gedevice.h" |
12 #include "xfa/fde/fde_iterator.h" | 14 #include "xfa/fde/fde_iterator.h" |
13 #include "xfa/fde/fde_visualset.h" | 15 #include "xfa/fde/fde_visualset.h" |
14 | 16 |
15 class CFDE_RenderDevice; | 17 class CFDE_RenderDevice; |
16 | 18 |
17 enum FDE_RENDERSTATUS { | 19 enum FDE_RENDERSTATUS { |
18 FDE_RENDERSTATUS_Reset = 0, | 20 FDE_RENDERSTATUS_Reset = 0, |
19 FDE_RENDERSTATUS_Paused, | 21 FDE_RENDERSTATUS_Paused, |
20 FDE_RENDERSTATUS_Done, | 22 FDE_RENDERSTATUS_Done, |
21 FDE_RENDERSTATUS_Failed, | 23 FDE_RENDERSTATUS_Failed, |
22 }; | 24 }; |
23 | 25 |
24 class CFDE_RenderContext : public CFX_Target { | 26 class CFDE_RenderContext : public CFX_Target { |
25 public: | 27 public: |
26 CFDE_RenderContext(); | 28 CFDE_RenderContext(); |
27 ~CFDE_RenderContext(); | 29 ~CFDE_RenderContext() override; |
28 | 30 |
29 void Release() { delete this; } | |
30 FX_BOOL StartRender(CFDE_RenderDevice* pRenderDevice, | 31 FX_BOOL StartRender(CFDE_RenderDevice* pRenderDevice, |
31 IFDE_CanvasSet* pCanvasSet, | 32 IFDE_CanvasSet* pCanvasSet, |
32 const CFX_Matrix& tmDoc2Device); | 33 const CFX_Matrix& tmDoc2Device); |
33 FDE_RENDERSTATUS GetStatus() const { return m_eStatus; } | 34 FDE_RENDERSTATUS GetStatus() const { return m_eStatus; } |
34 FDE_RENDERSTATUS DoRender(IFX_Pause* pPause = nullptr); | 35 FDE_RENDERSTATUS DoRender(IFX_Pause* pPause = nullptr); |
35 void StopRender(); | 36 void StopRender(); |
36 void RenderText(IFDE_TextSet* pTextSet, FDE_HVISUALOBJ hText); | 37 void RenderText(IFDE_TextSet* pTextSet, FDE_HVISUALOBJ hText); |
37 FX_BOOL ApplyClip(IFDE_VisualSet* pVisualSet, | 38 FX_BOOL ApplyClip(IFDE_VisualSet* pVisualSet, |
38 FDE_HVISUALOBJ hObj, | 39 FDE_HVISUALOBJ hObj, |
39 FDE_HDEVICESTATE& hState); | 40 FDE_HDEVICESTATE& hState); |
40 void RestoreClip(FDE_HDEVICESTATE hState); | 41 void RestoreClip(FDE_HDEVICESTATE hState); |
41 | 42 |
42 protected: | 43 protected: |
43 FDE_RENDERSTATUS m_eStatus; | 44 FDE_RENDERSTATUS m_eStatus; |
44 CFDE_RenderDevice* m_pRenderDevice; | 45 CFDE_RenderDevice* m_pRenderDevice; |
45 CFDE_Brush* m_pBrush; | |
46 CFX_Matrix m_Transform; | 46 CFX_Matrix m_Transform; |
47 FXTEXT_CHARPOS* m_pCharPos; | 47 FXTEXT_CHARPOS* m_pCharPos; |
48 int32_t m_iCharPosCount; | 48 int32_t m_iCharPosCount; |
49 CFDE_VisualSetIterator* m_pIterator; | 49 std::unique_ptr<CFDE_Brush> m_pBrush; |
| 50 std::unique_ptr<CFDE_VisualSetIterator> m_pIterator; |
50 }; | 51 }; |
51 | 52 |
52 #endif // XFA_FDE_FDE_RENDER_H_ | 53 #endif // XFA_FDE_FDE_RENDER_H_ |
OLD | NEW |