diff options
author | Nico Weber <thakis@chromium.org> | 2015-08-04 13:00:21 -0700 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2015-08-04 13:00:21 -0700 |
commit | 9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f (patch) | |
tree | c97037f398d714665aefccb6eb54d0969ad7030c /fpdfsdk/src/fpdf_progressive.cpp | |
parent | 780cee82236d1b3b0f9b01a22424e4b8ec9a6f12 (diff) | |
download | pdfium-9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f.tar.xz |
XFA: clang-format all pdfium code.
No behavior change.
Generated by:
find . -name '*.cpp' -o -name '*.h' | \
grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \
xargs ../../buildtools/mac/clang-format -i
Then manually merged https://codereview.chromium.org/1269223002/
See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion.
BUG=none
Diffstat (limited to 'fpdfsdk/src/fpdf_progressive.cpp')
-rw-r--r-- | fpdfsdk/src/fpdf_progressive.cpp | 170 |
1 files changed, 87 insertions, 83 deletions
diff --git a/fpdfsdk/src/fpdf_progressive.cpp b/fpdfsdk/src/fpdf_progressive.cpp index f47cd7dde6..9167a77c46 100644 --- a/fpdfsdk/src/fpdf_progressive.cpp +++ b/fpdfsdk/src/fpdf_progressive.cpp @@ -11,100 +11,104 @@ #include "../include/fpdfxfa/fpdfxfa_doc.h" #include "../include/fpdfxfa/fpdfxfa_page.h" -DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE page, - int start_x, int start_y, int size_x, - int size_y, int rotate, int flags, - IFSDK_PAUSE * pause ) -{ - if (bitmap == NULL || page == NULL) - return FPDF_RENDER_FAILED; - - if (!pause) - return FPDF_RENDER_FAILED; - - if (pause->version !=1) - return FPDF_RENDER_FAILED; - - CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); - if (!pPage) - return FPDF_RENDER_FAILED; - -// FXMT_CSLOCK_OBJ(&pPage->m_PageLock); - - CRenderContext* pContext = FX_NEW CRenderContext; - pPage->SetPrivateData((void*)1, pContext, DropContext ); +DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, + FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int flags, + IFSDK_PAUSE* pause) { + if (bitmap == NULL || page == NULL) + return FPDF_RENDER_FAILED; + + if (!pause) + return FPDF_RENDER_FAILED; + + if (pause->version != 1) + return FPDF_RENDER_FAILED; + + CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); + if (!pPage) + return FPDF_RENDER_FAILED; + + // FXMT_CSLOCK_OBJ(&pPage->m_PageLock); + + CRenderContext* pContext = FX_NEW CRenderContext; + pPage->SetPrivateData((void*)1, pContext, DropContext); #ifdef _SKIA_SUPPORT_ - pContext->m_pDevice = FX_NEW CFX_SkiaDevice; - if (flags & FPDF_REVERSE_BYTE_ORDER) - ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE); - else - ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap); + pContext->m_pDevice = FX_NEW CFX_SkiaDevice; + if (flags & FPDF_REVERSE_BYTE_ORDER) + ((CFX_SkiaDevice*)pContext->m_pDevice) + ->Attach((CFX_DIBitmap*)bitmap, 0, TRUE); + else + ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap); #else - pContext->m_pDevice = FX_NEW CFX_FxgeDevice; - if (flags & FPDF_REVERSE_BYTE_ORDER) - ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE); - else - ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap); + pContext->m_pDevice = FX_NEW CFX_FxgeDevice; + if (flags & FPDF_REVERSE_BYTE_ORDER) + ((CFX_FxgeDevice*)pContext->m_pDevice) + ->Attach((CFX_DIBitmap*)bitmap, 0, TRUE); + else + ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap); #endif - IFSDK_PAUSE_Adapter IPauseAdapter(pause); - - FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y, - rotate, flags,FALSE, &IPauseAdapter); - - if ( pContext->m_pRenderer ) - { - CPDF_ProgressiveRenderer::RenderStatus status = CPDF_ProgressiveRenderer::Failed; - status = pContext->m_pRenderer->GetStatus(); - return status; - } - return FPDF_RENDER_FAILED; + IFSDK_PAUSE_Adapter IPauseAdapter(pause); + + FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y, + rotate, flags, FALSE, &IPauseAdapter); + + if (pContext->m_pRenderer) { + CPDF_ProgressiveRenderer::RenderStatus status = + CPDF_ProgressiveRenderer::Failed; + status = pContext->m_pRenderer->GetStatus(); + return status; + } + return FPDF_RENDER_FAILED; } -DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,IFSDK_PAUSE * pause) -{ - if (page == NULL) - return FPDF_RENDER_FAILED; +DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page, + IFSDK_PAUSE* pause) { + if (page == NULL) + return FPDF_RENDER_FAILED; - if (!pause) - return FPDF_RENDER_FAILED; + if (!pause) + return FPDF_RENDER_FAILED; - if (pause->version !=1) - return FPDF_RENDER_FAILED; + if (pause->version != 1) + return FPDF_RENDER_FAILED; - CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); - if (!pPage) - return FPDF_RENDER_FAILED; + CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); + if (!pPage) + return FPDF_RENDER_FAILED; -// FXMT_CSLOCK_OBJ(&pPage->m_PageLock); + // FXMT_CSLOCK_OBJ(&pPage->m_PageLock); - CRenderContext * pContext = (CRenderContext*)pPage->GetPrivateData((void*)1); - if (pContext && pContext->m_pRenderer) - { - IFSDK_PAUSE_Adapter IPauseAdapter(pause); - pContext->m_pRenderer->Continue(&IPauseAdapter); + CRenderContext* pContext = (CRenderContext*)pPage->GetPrivateData((void*)1); + if (pContext && pContext->m_pRenderer) { + IFSDK_PAUSE_Adapter IPauseAdapter(pause); + pContext->m_pRenderer->Continue(&IPauseAdapter); - CPDF_ProgressiveRenderer::RenderStatus status = CPDF_ProgressiveRenderer::Failed; - status = pContext->m_pRenderer->GetStatus(); - return status; - } - return FPDF_RENDER_FAILED; + CPDF_ProgressiveRenderer::RenderStatus status = + CPDF_ProgressiveRenderer::Failed; + status = pContext->m_pRenderer->GetStatus(); + return status; + } + return FPDF_RENDER_FAILED; } - -DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page) -{ - if (page == NULL) return; - CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); - if (!pPage) return; - -// FXMT_CSLOCK_OBJ(&pPage->m_PageLock); - - CRenderContext * pContext = (CRenderContext*)pPage->GetPrivateData((void*)1); - if (pContext) - { - pContext->m_pDevice->RestoreState(); - delete pContext; - pPage->RemovePrivateData((void*)1); - } +DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page) { + if (page == NULL) + return; + CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); + if (!pPage) + return; + + // FXMT_CSLOCK_OBJ(&pPage->m_PageLock); + + CRenderContext* pContext = (CRenderContext*)pPage->GetPrivateData((void*)1); + if (pContext) { + pContext->m_pDevice->RestoreState(); + delete pContext; + pPage->RemovePrivateData((void*)1); + } } - |