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 CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ |
8 #define CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ | 8 #define CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ |
9 | 9 |
10 #include "../../../third_party/base/nonstd_unique_ptr.h" | |
11 #include "../../../public/fpdf_progressive.h" | |
10 #include "../fxge/fx_ge.h" | 12 #include "../fxge/fx_ge.h" |
11 #include "fpdf_page.h" | 13 #include "fpdf_page.h" |
12 | 14 |
15 class CFX_GraphStateData; | |
16 class CFX_PathData; | |
17 class CFX_RenderDevice; | |
18 class CPDF_FormObject; | |
19 class CPDF_ImageCache; | |
20 class CPDF_ImageObject; | |
21 class CPDF_PathObject; | |
22 class CPDF_QuickStretcher; | |
13 class CPDF_RenderContext; | 23 class CPDF_RenderContext; |
14 class CPDF_RenderOptions; | 24 class CPDF_RenderOptions; |
15 class CPDF_ImageCache; | 25 class CPDF_RenderStatus; |
16 class IPDF_OCContext; | 26 class CPDF_ShadingObject; |
17 class CPDF_QuickStretcher; | |
18 class CFX_PathData; | |
19 class CFX_GraphStateData; | |
20 class CFX_RenderDevice; | |
21 class CPDF_TextObject; | 27 class CPDF_TextObject; |
22 class CPDF_PathObject; | 28 class IFX_Pause; |
23 class CPDF_ImageObject; | 29 |
24 class CPDF_ShadingObject; | |
25 class CPDF_FormObject; | |
26 class IPDF_OCContext | 30 class IPDF_OCContext |
27 { | 31 { |
28 public: | 32 public: |
29 | 33 |
30 virtual ~IPDF_OCContext() {} | 34 virtual ~IPDF_OCContext() {} |
31 | 35 |
32 virtual FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCG) = 0; | 36 virtual FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCG) = 0; |
33 | 37 |
34 FX_BOOL CheckObjectVisible(const CPDF_PageObject* pObj); | 38 FX_BOOL CheckObjectVisible(const CPDF_PageObject* pObj); |
35 }; | 39 }; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 FX_BOOL m_bFirstLayer; | 129 FX_BOOL m_bFirstLayer; |
126 | 130 |
127 void Render(CFX_RenderDevice* pDevice, const CPDF_Pag eObject* pStopObj, | 131 void Render(CFX_RenderDevice* pDevice, const CPDF_Pag eObject* pStopObj, |
128 const CPDF_RenderOptions* pOptions, const CFX_AffineM atrix* pFinalMatrix); | 132 const CPDF_RenderOptions* pOptions, const CFX_AffineM atrix* pFinalMatrix); |
129 friend class CPDF_RenderStatus; | 133 friend class CPDF_RenderStatus; |
130 friend class CPDF_ProgressiveRenderer; | 134 friend class CPDF_ProgressiveRenderer; |
131 }; | 135 }; |
132 class CPDF_ProgressiveRenderer | 136 class CPDF_ProgressiveRenderer |
133 { | 137 { |
134 public: | 138 public: |
139 // Must match FDF_RENDER_* definitions in fpdf_progressive.h. | |
140 enum Status { | |
141 Ready = FPDF_RENDER_READER, | |
142 ToBeContinued = FPDF_RENDER_TOBECOUNTINUED, | |
143 Done = FPDF_RENDER_DONE, | |
144 Failed = FPDF_RENDER_FAILED | |
145 }; | |
146 static int ToFPDFStatus(Status status) { return static_cast<int>(status); } | |
135 | 147 |
136 CPDF_ProgressiveRenderer(); | 148 CPDF_ProgressiveRenderer(CPDF_RenderContext* pContext, |
137 | 149 CFX_RenderDevice* pDevice, |
150 const CPDF_RenderOptions* pOptions); | |
138 ~CPDF_ProgressiveRenderer(); | 151 ~CPDF_ProgressiveRenderer(); |
139 | 152 |
140 typedef enum { | 153 Status GetStatus() const { return m_Status; } |
141 Ready, | 154 void Start(IFX_Pause* pPause); |
142 ToBeContinued, | 155 void Continue(IFX_Pause* pPause); |
143 Done, | 156 int»EstimateProgress(); |
Lei Zhang
2015/07/17 01:06:35
remove tab
Tom Sepez
2015/07/17 16:58:22
Done.
| |
144 Failed | |
145 } RenderStatus; | |
146 | 157 |
147 RenderStatus» » GetStatus() | 158 private: |
148 { | 159 void RenderStep(); |
149 return m_Status; | |
150 } | |
151 | 160 |
152 | 161 Status m_Status; |
153 | 162 CPDF_RenderContext* const m_pContext; |
154 void» » » » Start(CPDF_RenderContext* pContext, CFX_ RenderDevice* pDevice, | 163 CFX_RenderDevice* const m_pDevice; |
155 const CPDF_RenderOptions* pOptions, class IFX_Paus e* pPause, FX_BOOL bDropObjects = FALSE); | 164 const CPDF_RenderOptions* const m_pOptions; |
156 | 165 nonstd::unique_ptr<CPDF_RenderStatus> m_pRenderStatus; |
157 void» » » » Continue(class IFX_Pause* pPause); | 166 CFX_FloatRect m_ClipRect; |
158 | 167 FX_DWORD m_LayerIndex; |
159 | 168 FX_DWORD m_ObjectIndex; |
160 int»» » » » EstimateProgress(); | 169 FX_POSITION m_ObjectPos; |
161 | 170 FX_POSITION m_PrevLastPos; |
162 void» » » » Clear(); | |
163 protected: | |
164 | |
165 RenderStatus» » m_Status; | |
166 | |
167 CPDF_RenderContext*»m_pContext; | |
168 | |
169 CFX_RenderDevice*» m_pDevice; | |
170 | |
171 const CPDF_RenderOptions*» m_pOptions; | |
172 | |
173 FX_BOOL» » » » m_bDropObjects; | |
174 | |
175 class CPDF_RenderStatus*» m_pRenderer; | |
176 | |
177 CFX_FloatRect» » m_ClipRect; | |
178 | |
179 FX_DWORD» » » m_LayerIndex; | |
180 | |
181 FX_DWORD» » » m_ObjectIndex; | |
182 | |
183 FX_POSITION»» » m_ObjectPos; | |
184 | |
185 FX_POSITION»» » m_PrevLastPos; | |
186 | |
187 void» » » » RenderStep(); | |
188 }; | 171 }; |
189 class CPDF_TextRenderer | 172 class CPDF_TextRenderer |
190 { | 173 { |
191 public: | 174 public: |
192 | 175 |
193 static void DrawTextString(CFX_RenderDevice* pDevice, int left, int top, | 176 static void DrawTextString(CFX_RenderDevice* pDevice, int left, int top, |
194 CPDF_Font* pFont, | 177 CPDF_Font* pFont, |
195 int height, | 178 int height, |
196 const CFX_ByteString& str, | 179 const CFX_ByteString& str, |
197 FX_ARGB argb); | 180 FX_ARGB argb); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
282 class CPDF_RenderConfig | 265 class CPDF_RenderConfig |
283 { | 266 { |
284 public: | 267 public: |
285 CPDF_RenderConfig(); | 268 CPDF_RenderConfig(); |
286 ~CPDF_RenderConfig(); | 269 ~CPDF_RenderConfig(); |
287 int m_HalftoneLimit; | 270 int m_HalftoneLimit; |
288 int m_RenderStepLimit; | 271 int m_RenderStepLimit; |
289 }; | 272 }; |
290 | 273 |
291 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ | 274 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ |
OLD | NEW |