| 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/fpdf_progressive.h" | 7 #include "../include/fpdf_progressive.h" |
| 8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
| 9 #include "../include/fpdfview.h" | 9 #include "../include/fpdfview.h" |
| 10 #include "../include/fsdk_rendercontext.h" | 10 #include "../include/fsdk_rendercontext.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 if (pause->version !=1) | 28 if (pause->version !=1) |
| 29 return FPDF_RENDER_FAILED; | 29 return FPDF_RENDER_FAILED; |
| 30 | 30 |
| 31 CPDF_Page* pPage = (CPDF_Page*)page; | 31 CPDF_Page* pPage = (CPDF_Page*)page; |
| 32 | 32 |
| 33 // FXMT_CSLOCK_OBJ(&pPage->m_PageLock); | 33 // FXMT_CSLOCK_OBJ(&pPage->m_PageLock); |
| 34 | 34 |
| 35 CRenderContext* pContext = FX_NEW CRenderContext; | 35 CRenderContext* pContext = FX_NEW CRenderContext; |
| 36 pPage->SetPrivateData((void*)1, pContext, DropContext ); | 36 pPage->SetPrivateData((void*)1, pContext, DropContext ); |
| 37 #ifdef _SKIA_SUPPORT_ | |
| 38 pContext->m_pDevice = FX_NEW CFX_SkiaDevice; | |
| 39 if (flags & FPDF_REVERSE_BYTE_ORDER) | |
| 40 ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bi
tmap,0,TRUE); | |
| 41 else | |
| 42 ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bi
tmap); | |
| 43 #else | |
| 44 pContext->m_pDevice = FX_NEW CFX_FxgeDevice; | 37 pContext->m_pDevice = FX_NEW CFX_FxgeDevice; |
| 45 if (flags & FPDF_REVERSE_BYTE_ORDER) | 38 if (flags & FPDF_REVERSE_BYTE_ORDER) |
| 46 ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bi
tmap,0,TRUE); | 39 ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bi
tmap,0,TRUE); |
| 47 else | 40 else |
| 48 ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bi
tmap); | 41 ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bi
tmap); |
| 49 #endif | 42 |
| 50 IFSDK_PAUSE_Adapter IPauseAdapter(pause); | 43 IFSDK_PAUSE_Adapter IPauseAdapter(pause); |
| 51 | 44 |
| 52 if (flags & FPDF_NO_CATCH) | 45 if (flags & FPDF_NO_CATCH) |
| 53 Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y
, rotate, flags,FALSE, &IPauseAdapter); | 46 Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y
, rotate, flags,FALSE, &IPauseAdapter); |
| 54 else { | 47 else { |
| 55 try { | 48 try { |
| 56 Func_RenderPage(pContext, page, start_x, start_y, size_x
, size_y, rotate, flags,FALSE, &IPauseAdapter); | 49 Func_RenderPage(pContext, page, start_x, start_y, size_x
, size_y, rotate, flags,FALSE, &IPauseAdapter); |
| 57 } | 50 } |
| 58 catch (...){} | 51 catch (...){} |
| 59 } | 52 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 98 |
| 106 CRenderContext * pContext = (CRenderContext*)pPage->GetPrivateData((void
*)1); | 99 CRenderContext * pContext = (CRenderContext*)pPage->GetPrivateData((void
*)1); |
| 107 if (pContext) | 100 if (pContext) |
| 108 { | 101 { |
| 109 pContext->m_pDevice->RestoreState(); | 102 pContext->m_pDevice->RestoreState(); |
| 110 delete pContext; | 103 delete pContext; |
| 111 pPage->RemovePrivateData((void*)1); | 104 pPage->RemovePrivateData((void*)1); |
| 112 } | 105 } |
| 113 } | 106 } |
| 114 | 107 |
| OLD | NEW |