OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 XFA_SRC_FDE_FDE_GEDEVICE_H_ | |
8 #define XFA_SRC_FDE_FDE_GEDEVICE_H_ | |
9 | |
10 #include "xfa/src/fde/fde_renderdevice.h" | |
11 #include "xfa/src/fgas/crt/fgas_memory.h" | |
12 | |
13 class CFDE_FxgeDevice : public IFDE_RenderDevice, public CFX_Target { | |
14 public: | |
15 CFDE_FxgeDevice(CFX_RenderDevice* pDevice, FX_BOOL bOwnerDevice); | |
16 ~CFDE_FxgeDevice(); | |
17 virtual void Release() { delete this; } | |
18 | |
19 virtual int32_t GetWidth() const; | |
20 virtual int32_t GetHeight() const; | |
21 virtual FDE_HDEVICESTATE SaveState(); | |
22 virtual void RestoreState(FDE_HDEVICESTATE hState); | |
23 virtual FX_BOOL SetClipPath(const IFDE_Path* pClip); | |
24 virtual IFDE_Path* GetClipPath() const; | |
25 virtual FX_BOOL SetClipRect(const CFX_RectF& rtClip); | |
26 virtual const CFX_RectF& GetClipRect(); | |
27 | |
28 virtual FX_FLOAT GetDpiX() const; | |
29 virtual FX_FLOAT GetDpiY() const; | |
30 | |
31 virtual FX_BOOL DrawImage(CFX_DIBSource* pDib, | |
32 const CFX_RectF* pSrcRect, | |
33 const CFX_RectF& dstRect, | |
34 const CFX_Matrix* pImgMatrix = NULL, | |
35 const CFX_Matrix* pDevMatrix = NULL); | |
36 virtual FX_BOOL DrawString(IFDE_Brush* pBrush, | |
37 IFX_Font* pFont, | |
38 const FXTEXT_CHARPOS* pCharPos, | |
39 int32_t iCount, | |
40 FX_FLOAT fFontSize, | |
41 const CFX_Matrix* pMatrix = NULL); | |
42 virtual FX_BOOL DrawBezier(IFDE_Pen* pPen, | |
43 FX_FLOAT fPenWidth, | |
44 const CFX_PointF& pt1, | |
45 const CFX_PointF& pt2, | |
46 const CFX_PointF& pt3, | |
47 const CFX_PointF& pt4, | |
48 const CFX_Matrix* pMatrix = NULL); | |
49 virtual FX_BOOL DrawCurve(IFDE_Pen* pPen, | |
50 FX_FLOAT fPenWidth, | |
51 const CFX_PointsF& points, | |
52 FX_BOOL bClosed, | |
53 FX_FLOAT fTension = 0.5f, | |
54 const CFX_Matrix* pMatrix = NULL); | |
55 virtual FX_BOOL DrawEllipse(IFDE_Pen* pPen, | |
56 FX_FLOAT fPenWidth, | |
57 const CFX_RectF& rect, | |
58 const CFX_Matrix* pMatrix = NULL); | |
59 virtual FX_BOOL DrawLines(IFDE_Pen* pPen, | |
60 FX_FLOAT fPenWidth, | |
61 const CFX_PointsF& points, | |
62 const CFX_Matrix* pMatrix = NULL); | |
63 virtual FX_BOOL DrawLine(IFDE_Pen* pPen, | |
64 FX_FLOAT fPenWidth, | |
65 const CFX_PointF& pt1, | |
66 const CFX_PointF& pt2, | |
67 const CFX_Matrix* pMatrix = NULL); | |
68 virtual FX_BOOL DrawPath(IFDE_Pen* pPen, | |
69 FX_FLOAT fPenWidth, | |
70 const IFDE_Path* pPath, | |
71 const CFX_Matrix* pMatrix = NULL); | |
72 virtual FX_BOOL DrawPolygon(IFDE_Pen* pPen, | |
73 FX_FLOAT fPenWidth, | |
74 const CFX_PointsF& points, | |
75 const CFX_Matrix* pMatrix = NULL); | |
76 virtual FX_BOOL DrawRectangle(IFDE_Pen* pPen, | |
77 FX_FLOAT fPenWidth, | |
78 const CFX_RectF& rect, | |
79 const CFX_Matrix* pMatrix = NULL); | |
80 virtual FX_BOOL FillClosedCurve(IFDE_Brush* pBrush, | |
81 const CFX_PointsF& points, | |
82 FX_FLOAT fTension = 0.5f, | |
83 const CFX_Matrix* pMatrix = NULL); | |
84 virtual FX_BOOL FillEllipse(IFDE_Brush* pBrush, | |
85 const CFX_RectF& rect, | |
86 const CFX_Matrix* pMatrix = NULL); | |
87 virtual FX_BOOL FillPath(IFDE_Brush* pBrush, | |
88 const IFDE_Path* pPath, | |
89 const CFX_Matrix* pMatrix = NULL); | |
90 virtual FX_BOOL FillPolygon(IFDE_Brush* pBrush, | |
91 const CFX_PointsF& points, | |
92 const CFX_Matrix* pMatrix = NULL); | |
93 virtual FX_BOOL FillRectangle(IFDE_Brush* pBrush, | |
94 const CFX_RectF& rect, | |
95 const CFX_Matrix* pMatrix = NULL); | |
96 FX_BOOL FillSolidPath(IFDE_Brush* pBrush, | |
97 const CFX_PathData* pPath, | |
98 const CFX_Matrix* pMatrix); | |
99 FX_BOOL FillHatchPath(IFDE_Brush* pBrush, | |
100 const CFX_PathData* pPath, | |
101 const CFX_Matrix* pMatrix); | |
102 FX_BOOL FillTexturePath(IFDE_Brush* pBrush, | |
103 const CFX_PathData* pPath, | |
104 const CFX_Matrix* pMatrix); | |
105 FX_BOOL FillLinearGradientPath(IFDE_Brush* pBrush, | |
106 const CFX_PathData* pPath, | |
107 const CFX_Matrix* pMatrix); | |
108 FX_BOOL DrawSolidString(IFDE_Brush* pBrush, | |
109 IFX_Font* pFont, | |
110 const FXTEXT_CHARPOS* pCharPos, | |
111 int32_t iCount, | |
112 FX_FLOAT fFontSize, | |
113 const CFX_Matrix* pMatrix); | |
114 FX_BOOL DrawStringPath(IFDE_Brush* pBrush, | |
115 IFX_Font* pFont, | |
116 const FXTEXT_CHARPOS* pCharPos, | |
117 int32_t iCount, | |
118 FX_FLOAT fFontSize, | |
119 const CFX_Matrix* pMatrix); | |
120 | |
121 protected: | |
122 FX_BOOL CreatePen(IFDE_Pen* pPen, | |
123 FX_FLOAT fPenWidth, | |
124 CFX_GraphStateData& graphState); | |
125 FX_BOOL WrapTexture(int32_t iWrapMode, | |
126 const CFX_DIBitmap* pBitmap, | |
127 const CFX_PathData* pPath, | |
128 const CFX_Matrix* pMatrix); | |
129 CFX_RenderDevice* m_pDevice; | |
130 CFX_RectF m_rtClip; | |
131 FX_BOOL m_bOwnerDevice; | |
132 FXTEXT_CHARPOS* m_pCharPos; | |
133 int32_t m_iCharCount; | |
134 }; | |
135 | |
136 #endif // XFA_SRC_FDE_FDE_GEDEVICE_H_ | |
OLD | NEW |