| 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 "../../public/fpdf_progressive.h" | 7 #include "../../public/fpdf_progressive.h" |
| 8 #include "../../public/fpdfview.h" | 8 #include "../../public/fpdfview.h" |
| 9 #include "../include/fsdk_define.h" | 9 #include "../include/fsdk_define.h" |
| 10 #include "../include/fsdk_rendercontext.h" | 10 #include "../include/fsdk_rendercontext.h" |
| 11 | 11 |
| 12 extern void (*Func_RenderPage)( CRenderContext*, FPDF_PAGE page, int start_x, in
t start_y, int size_x, int size_y, | |
| 13 int rotate, int flags,FX_BOOL bN
eedToRestore, IFSDK_PAUSE_Adapter * pause ); | |
| 14 | |
| 15 extern void DropContext(void* data); | |
| 16 | |
| 17 DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE
page, | 12 DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE
page, |
| 18
int start_x, int start_y, int size_x, | 13
int start_x, int start_y, int size_x, |
| 19
int size_y, int rotate, int flags, | 14
int size_y, int rotate, int flags, |
| 20
IFSDK_PAUSE * pause ) | 15
IFSDK_PAUSE * pause ) |
| 21 { | 16 { |
| 22 if (bitmap == NULL || page == NULL) | 17 if (bitmap == NULL || page == NULL) |
| 23 return FPDF_RENDER_FAILED; | 18 return FPDF_RENDER_FAILED; |
| 24 | 19 |
| 25 if (!pause) | 20 if (!pause) |
| 26 return FPDF_RENDER_FAILED; | 21 return FPDF_RENDER_FAILED; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 39 ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bi
tmap); | 34 ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bi
tmap); |
| 40 #else | 35 #else |
| 41 pContext->m_pDevice = new CFX_FxgeDevice; | 36 pContext->m_pDevice = new CFX_FxgeDevice; |
| 42 if (flags & FPDF_REVERSE_BYTE_ORDER) | 37 if (flags & FPDF_REVERSE_BYTE_ORDER) |
| 43 ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bi
tmap,0,TRUE); | 38 ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bi
tmap,0,TRUE); |
| 44 else | 39 else |
| 45 ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bi
tmap); | 40 ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bi
tmap); |
| 46 #endif | 41 #endif |
| 47 IFSDK_PAUSE_Adapter IPauseAdapter(pause); | 42 IFSDK_PAUSE_Adapter IPauseAdapter(pause); |
| 48 | 43 |
| 49 » Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate
, flags,FALSE, &IPauseAdapter); | 44 FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y, |
| 45 rotate, flags,FALSE, &IPauseAdapter); |
| 50 | 46 |
| 51 if ( pContext->m_pRenderer ) | 47 if ( pContext->m_pRenderer ) |
| 52 { | 48 { |
| 53 CPDF_ProgressiveRenderer::RenderStatus status = CPDF_Progressive
Renderer::Failed; | 49 CPDF_ProgressiveRenderer::RenderStatus status = CPDF_Progressive
Renderer::Failed; |
| 54 status = pContext->m_pRenderer->GetStatus(); | 50 status = pContext->m_pRenderer->GetStatus(); |
| 55 return status; | 51 return status; |
| 56 } | 52 } |
| 57 return FPDF_RENDER_FAILED; | 53 return FPDF_RENDER_FAILED; |
| 58 } | 54 } |
| 59 | 55 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 91 |
| 96 CRenderContext * pContext = (CRenderContext*)pPage->GetPrivateData((void
*)1); | 92 CRenderContext * pContext = (CRenderContext*)pPage->GetPrivateData((void
*)1); |
| 97 if (pContext) | 93 if (pContext) |
| 98 { | 94 { |
| 99 pContext->m_pDevice->RestoreState(); | 95 pContext->m_pDevice->RestoreState(); |
| 100 delete pContext; | 96 delete pContext; |
| 101 pPage->RemovePrivateData((void*)1); | 97 pPage->RemovePrivateData((void*)1); |
| 102 } | 98 } |
| 103 } | 99 } |
| 104 | 100 |
| OLD | NEW |