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 #include "../include/fpdfview.h" | 7 #include "../include/fpdfview.h" |
8 #include "../include/fpdfformfill.h" | 8 #include "../include/fpdfformfill.h" |
9 #include "../include/fsdk_define.h" | 9 #include "../include/fsdk_define.h" |
10 #include "../include/fsdk_mgr.h" | 10 #include "../include/fsdk_mgr.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 else | 199 else |
200 options.m_Flags &= ~RENDER_CLEARTYPE; | 200 options.m_Flags &= ~RENDER_CLEARTYPE; |
201 | 201 |
202 //Grayscale output | 202 //Grayscale output |
203 if (flags & FPDF_GRAYSCALE) | 203 if (flags & FPDF_GRAYSCALE) |
204 { | 204 { |
205 options.m_ColorMode = RENDER_COLOR_GRAY; | 205 options.m_ColorMode = RENDER_COLOR_GRAY; |
206 options.m_ForeColor = 0; | 206 options.m_ForeColor = 0; |
207 options.m_BackColor = 0xffffff; | 207 options.m_BackColor = 0xffffff; |
208 } | 208 } |
209 » | 209 |
210 options.m_AddFlags = flags >> 8; | 210 options.m_AddFlags = flags >> 8; |
| 211 options.m_pOCContext = new CPDF_OCContext(pPage->m_pDocument); |
211 | 212 |
212 options.m_pOCContext = FX_NEW CPDF_OCContext(pPage->m_pDocument); | |
213 | |
214 //FXMT_CSLOCK_OBJ(&pPage->m_PageLock); | |
215 | |
216 CFX_AffineMatrix matrix; | 213 CFX_AffineMatrix matrix; |
217 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate
); | 214 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate
); |
218 | 215 |
219 FX_RECT clip; | 216 FX_RECT clip; |
220 clip.left = start_x; | 217 clip.left = start_x; |
221 clip.right = start_x + size_x; | 218 clip.right = start_x + size_x; |
222 clip.top = start_y; | 219 clip.top = start_y; |
223 clip.bottom = start_y + size_y; | 220 clip.bottom = start_y + size_y; |
224 | 221 |
225 #ifdef _SKIA_SUPPORT_ | 222 #ifdef _SKIA_SUPPORT_ |
226 » CFX_SkiaDevice* pDevice = FX_NEW CFX_SkiaDevice; | 223 » CFX_SkiaDevice* pDevice = new CFX_SkiaDevice; |
227 #else | 224 #else |
228 » CFX_FxgeDevice* pDevice = NULL; | 225 » CFX_FxgeDevice* pDevice = new CFX_FxgeDevice; |
229 » pDevice = FX_NEW CFX_FxgeDevice; | |
230 #endif | 226 #endif |
231 | |
232 if (!pDevice) | |
233 return; | |
234 pDevice->Attach((CFX_DIBitmap*)bitmap); | 227 pDevice->Attach((CFX_DIBitmap*)bitmap); |
235 pDevice->SaveState(); | 228 pDevice->SaveState(); |
236 pDevice->SetClip_Rect(&clip); | 229 pDevice->SetClip_Rect(&clip); |
237 | |
238 | 230 |
239 » CPDF_RenderContext* pContext = NULL; | 231 » CPDF_RenderContext* pContext = new CPDF_RenderContext; |
240 » pContext = FX_NEW CPDF_RenderContext; | |
241 » if (!pContext) | |
242 » { | |
243 » » delete pDevice; | |
244 » » pDevice = NULL; | |
245 » » return; | |
246 » } | |
247 | |
248 | |
249 //» CPDF_Document* pDoc = pPage->m_pDocument; | |
250 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; | 232 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; |
251 CPDFSDK_Document* pFXDoc = pEnv->GetCurrentDoc(); | 233 CPDFSDK_Document* pFXDoc = pEnv->GetCurrentDoc(); |
252 if(!pFXDoc) | 234 if(!pFXDoc) |
253 { | 235 { |
254 delete pContext; | 236 delete pContext; |
255 delete pDevice; | 237 delete pDevice; |
256 pContext = NULL; | 238 pContext = NULL; |
257 pDevice = NULL; | 239 pDevice = NULL; |
258 return; | 240 return; |
259 } | 241 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 if (bExistCAAction) | 414 if (bExistCAAction) |
433 { | 415 { |
434 CPDF_Action action = aa.GetAction(CPDF_AAction::
ClosePage); | 416 CPDF_Action action = aa.GetAction(CPDF_AAction::
ClosePage); |
435 pActionHandler->DoAction_Page(action, CPDF_AActi
on::ClosePage, pSDKDoc); | 417 pActionHandler->DoAction_Page(action, CPDF_AActi
on::ClosePage, pSDKDoc); |
436 } | 418 } |
437 } | 419 } |
438 } | 420 } |
439 } | 421 } |
440 | 422 |
441 | 423 |
OLD | NEW |