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 "core/include/fxge/fx_ge.h" | 10 #include "core/include/fxge/fx_ge.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 void Create(CPDF_Document* pDoc = NULL, | 87 void Create(CPDF_Document* pDoc = NULL, |
88 CPDF_PageRenderCache* pPageCache = NULL, | 88 CPDF_PageRenderCache* pPageCache = NULL, |
89 CPDF_Dictionary* pPageResources = NULL, | 89 CPDF_Dictionary* pPageResources = NULL, |
90 FX_BOOL bFirstLayer = TRUE); | 90 FX_BOOL bFirstLayer = TRUE); |
91 | 91 |
92 ~CPDF_RenderContext(); | 92 ~CPDF_RenderContext(); |
93 | 93 |
94 void Clear(); | 94 void Clear(); |
95 | 95 |
96 void AppendObjectList(CPDF_PageObjects* pObjs, | 96 void AppendObjectList(CPDF_PageObjects* pObjs, |
97 const CFX_AffineMatrix* pObject2Device); | 97 const CFX_Matrix* pObject2Device); |
98 | 98 |
99 void Render(CFX_RenderDevice* pDevice, | 99 void Render(CFX_RenderDevice* pDevice, |
100 const CPDF_RenderOptions* pOptions = NULL, | 100 const CPDF_RenderOptions* pOptions = NULL, |
101 const CFX_AffineMatrix* pFinalMatrix = NULL); | 101 const CFX_Matrix* pFinalMatrix = NULL); |
102 | 102 |
103 void DrawObjectList(CFX_RenderDevice* pDevice, | 103 void DrawObjectList(CFX_RenderDevice* pDevice, |
104 CPDF_PageObjects* pObjs, | 104 CPDF_PageObjects* pObjs, |
105 const CFX_AffineMatrix* pObject2Device, | 105 const CFX_Matrix* pObject2Device, |
106 const CPDF_RenderOptions* pOptions); | 106 const CPDF_RenderOptions* pOptions); |
107 | 107 |
108 void GetBackground(CFX_DIBitmap* pBuffer, | 108 void GetBackground(CFX_DIBitmap* pBuffer, |
109 const CPDF_PageObject* pObj, | 109 const CPDF_PageObject* pObj, |
110 const CPDF_RenderOptions* pOptions, | 110 const CPDF_RenderOptions* pOptions, |
111 CFX_AffineMatrix* pFinalMatrix); | 111 CFX_Matrix* pFinalMatrix); |
112 | 112 |
113 CPDF_PageRenderCache* GetPageCache() const { return m_pPageCache; } | 113 CPDF_PageRenderCache* GetPageCache() const { return m_pPageCache; } |
114 | 114 |
115 CPDF_Document* m_pDocument; | 115 CPDF_Document* m_pDocument; |
116 | 116 |
117 CPDF_Dictionary* m_pPageResources; | 117 CPDF_Dictionary* m_pPageResources; |
118 | 118 |
119 CPDF_PageRenderCache* m_pPageCache; | 119 CPDF_PageRenderCache* m_pPageCache; |
120 | 120 |
121 protected: | 121 protected: |
122 CFX_ArrayTemplate<struct _PDF_RenderItem> m_ContentList; | 122 CFX_ArrayTemplate<struct _PDF_RenderItem> m_ContentList; |
123 | 123 |
124 FX_BOOL m_bFirstLayer; | 124 FX_BOOL m_bFirstLayer; |
125 | 125 |
126 void Render(CFX_RenderDevice* pDevice, | 126 void Render(CFX_RenderDevice* pDevice, |
127 const CPDF_PageObject* pStopObj, | 127 const CPDF_PageObject* pStopObj, |
128 const CPDF_RenderOptions* pOptions, | 128 const CPDF_RenderOptions* pOptions, |
129 const CFX_AffineMatrix* pFinalMatrix); | 129 const CFX_Matrix* pFinalMatrix); |
130 friend class CPDF_RenderStatus; | 130 friend class CPDF_RenderStatus; |
131 friend class CPDF_ProgressiveRenderer; | 131 friend class CPDF_ProgressiveRenderer; |
132 }; | 132 }; |
133 | 133 |
134 class CPDF_ProgressiveRenderer { | 134 class CPDF_ProgressiveRenderer { |
135 public: | 135 public: |
136 // Must match FDF_RENDER_* definitions in public/fpdf_progressive.h, but | 136 // Must match FDF_RENDER_* definitions in public/fpdf_progressive.h, but |
137 // cannot #include that header. fpdfsdk/src/fpdf_progressive.cpp has | 137 // cannot #include that header. fpdfsdk/src/fpdf_progressive.cpp has |
138 // static_asserts to make sure the two sets of values match. | 138 // static_asserts to make sure the two sets of values match. |
139 enum Status { | 139 enum Status { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 CPDF_Font* pFont, | 178 CPDF_Font* pFont, |
179 int height, | 179 int height, |
180 const CFX_ByteString& str, | 180 const CFX_ByteString& str, |
181 FX_ARGB argb); | 181 FX_ARGB argb); |
182 | 182 |
183 static void DrawTextString(CFX_RenderDevice* pDevice, | 183 static void DrawTextString(CFX_RenderDevice* pDevice, |
184 FX_FLOAT origin_x, | 184 FX_FLOAT origin_x, |
185 FX_FLOAT origin_y, | 185 FX_FLOAT origin_y, |
186 CPDF_Font* pFont, | 186 CPDF_Font* pFont, |
187 FX_FLOAT font_size, | 187 FX_FLOAT font_size, |
188 const CFX_AffineMatrix* matrix, | 188 const CFX_Matrix* matrix, |
189 const CFX_ByteString& str, | 189 const CFX_ByteString& str, |
190 FX_ARGB fill_argb, | 190 FX_ARGB fill_argb, |
191 FX_ARGB stroke_argb = 0, | 191 FX_ARGB stroke_argb = 0, |
192 const CFX_GraphStateData* pGraphState = NULL, | 192 const CFX_GraphStateData* pGraphState = NULL, |
193 const CPDF_RenderOptions* pOptions = NULL); | 193 const CPDF_RenderOptions* pOptions = NULL); |
194 | 194 |
195 static FX_BOOL DrawTextPath(CFX_RenderDevice* pDevice, | 195 static FX_BOOL DrawTextPath(CFX_RenderDevice* pDevice, |
196 int nChars, | 196 int nChars, |
197 FX_DWORD* pCharCodes, | 197 FX_DWORD* pCharCodes, |
198 FX_FLOAT* pCharPos, | 198 FX_FLOAT* pCharPos, |
199 CPDF_Font* pFont, | 199 CPDF_Font* pFont, |
200 FX_FLOAT font_size, | 200 FX_FLOAT font_size, |
201 const CFX_AffineMatrix* pText2User, | 201 const CFX_Matrix* pText2User, |
202 const CFX_AffineMatrix* pUser2Device, | 202 const CFX_Matrix* pUser2Device, |
203 const CFX_GraphStateData* pGraphState, | 203 const CFX_GraphStateData* pGraphState, |
204 FX_ARGB fill_argb, | 204 FX_ARGB fill_argb, |
205 FX_ARGB stroke_argb, | 205 FX_ARGB stroke_argb, |
206 CFX_PathData* pClippingPath, | 206 CFX_PathData* pClippingPath, |
207 int nFlag = 0); | 207 int nFlag = 0); |
208 | 208 |
209 static FX_BOOL DrawNormalText(CFX_RenderDevice* pDevice, | 209 static FX_BOOL DrawNormalText(CFX_RenderDevice* pDevice, |
210 int nChars, | 210 int nChars, |
211 FX_DWORD* pCharCodes, | 211 FX_DWORD* pCharCodes, |
212 FX_FLOAT* pCharPos, | 212 FX_FLOAT* pCharPos, |
213 CPDF_Font* pFont, | 213 CPDF_Font* pFont, |
214 FX_FLOAT font_size, | 214 FX_FLOAT font_size, |
215 const CFX_AffineMatrix* pText2Device, | 215 const CFX_Matrix* pText2Device, |
216 FX_ARGB fill_argb, | 216 FX_ARGB fill_argb, |
217 const CPDF_RenderOptions* pOptions); | 217 const CPDF_RenderOptions* pOptions); |
218 | 218 |
219 static FX_BOOL DrawType3Text(CFX_RenderDevice* pDevice, | 219 static FX_BOOL DrawType3Text(CFX_RenderDevice* pDevice, |
220 int nChars, | 220 int nChars, |
221 FX_DWORD* pCharCodes, | 221 FX_DWORD* pCharCodes, |
222 FX_FLOAT* pCharPos, | 222 FX_FLOAT* pCharPos, |
223 CPDF_Font* pFont, | 223 CPDF_Font* pFont, |
224 FX_FLOAT font_size, | 224 FX_FLOAT font_size, |
225 const CFX_AffineMatrix* pText2Device, | 225 const CFX_Matrix* pText2Device, |
226 FX_ARGB fill_argb); | 226 FX_ARGB fill_argb); |
227 }; | 227 }; |
228 class CPDF_PageRenderCache { | 228 class CPDF_PageRenderCache { |
229 public: | 229 public: |
230 CPDF_PageRenderCache(CPDF_Page* pPage) { | 230 CPDF_PageRenderCache(CPDF_Page* pPage) { |
231 m_pPage = pPage; | 231 m_pPage = pPage; |
232 m_nTimeCount = 0; | 232 m_nTimeCount = 0; |
233 m_nCacheSize = 0; | 233 m_nCacheSize = 0; |
234 m_pCurImageCache = NULL; | 234 m_pCurImageCache = NULL; |
235 m_bCurFindCache = FALSE; | 235 m_bCurFindCache = FALSE; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 FX_BOOL m_bCurFindCache; | 281 FX_BOOL m_bCurFindCache; |
282 }; | 282 }; |
283 class CPDF_RenderConfig { | 283 class CPDF_RenderConfig { |
284 public: | 284 public: |
285 CPDF_RenderConfig(); | 285 CPDF_RenderConfig(); |
286 ~CPDF_RenderConfig(); | 286 ~CPDF_RenderConfig(); |
287 int m_HalftoneLimit; | 287 int m_HalftoneLimit; |
288 int m_RenderStepLimit; | 288 int m_RenderStepLimit; |
289 }; | 289 }; |
290 | 290 |
291 FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix); | 291 FX_BOOL IsAvailableMatrix(const CFX_Matrix& matrix); |
292 | 292 |
293 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ | 293 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RENDER_H_ |
OLD | NEW |