summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdf_progressive.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2015-08-04 12:19:10 -0700
committerNico Weber <thakis@chromium.org>2015-08-04 12:19:10 -0700
commitb048f791a15f2da781a01eba5b09eb9d389f9c11 (patch)
tree6850a73c18bbc41eaf4b1fdc6b3c96646d45587b /fpdfsdk/src/fpdf_progressive.cpp
parentc8eeed31f217d99a706b0cbf5e4ce0bcc12beb64 (diff)
downloadpdfium-b048f791a15f2da781a01eba5b09eb9d389f9c11.tar.xz
clang-format all pdfium code.
No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163' | \ xargs ../../buildtools/mac/clang-format -i See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1265503005 .
Diffstat (limited to 'fpdfsdk/src/fpdf_progressive.cpp')
-rw-r--r--fpdfsdk/src/fpdf_progressive.cpp134
1 files changed, 69 insertions, 65 deletions
diff --git a/fpdfsdk/src/fpdf_progressive.cpp b/fpdfsdk/src/fpdf_progressive.cpp
index 4ec73ac2ba..aaa55a18f6 100644
--- a/fpdfsdk/src/fpdf_progressive.cpp
+++ b/fpdfsdk/src/fpdf_progressive.cpp
@@ -9,82 +9,86 @@
#include "../include/fsdk_define.h"
#include "../include/fsdk_rendercontext.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 = (CPDF_Page*)page;
- CRenderContext* pContext = 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 = (CPDF_Page*)page;
+ CRenderContext* pContext = new CRenderContext;
+ pPage->SetPrivateData((void*)1, pContext, DropContext);
#ifdef _SKIA_SUPPORT_
- pContext->m_pDevice = 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 = 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 = 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 = 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);
+ IFSDK_PAUSE_Adapter IPauseAdapter(pause);
- FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
- rotate, flags,FALSE, &IPauseAdapter);
+ FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
+ rotate, flags, FALSE, &IPauseAdapter);
- if (pContext->m_pRenderer)
- return CPDF_ProgressiveRenderer::ToFPDFStatus(pContext->m_pRenderer->GetStatus());
+ if (pContext->m_pRenderer)
+ return CPDF_ProgressiveRenderer::ToFPDFStatus(
+ pContext->m_pRenderer->GetStatus());
- return FPDF_RENDER_FAILED;
+ 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->version !=1)
- return FPDF_RENDER_FAILED;
-
- CPDF_Page* pPage = (CPDF_Page*)page;
- CRenderContext * pContext = (CRenderContext*)pPage->GetPrivateData((void*)1);
- if (pContext && pContext->m_pRenderer)
- {
- IFSDK_PAUSE_Adapter IPauseAdapter(pause);
- pContext->m_pRenderer->Continue(&IPauseAdapter);
- return CPDF_ProgressiveRenderer::ToFPDFStatus(pContext->m_pRenderer->GetStatus());
- }
+DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,
+ IFSDK_PAUSE* pause) {
+ if (page == NULL)
return FPDF_RENDER_FAILED;
-}
-
-DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page)
-{
- if (!page)
- return;
+ if (!pause)
+ return FPDF_RENDER_FAILED;
- CPDF_Page* pPage = (CPDF_Page*)page;
- CRenderContext * pContext = (CRenderContext*)pPage->GetPrivateData((void*)1);
- if (!pContext)
- return;
+ if (pause->version != 1)
+ return FPDF_RENDER_FAILED;
- pContext->m_pDevice->RestoreState();
- delete pContext;
- pPage->RemovePrivateData((void*)1);
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CRenderContext* pContext = (CRenderContext*)pPage->GetPrivateData((void*)1);
+ if (pContext && pContext->m_pRenderer) {
+ IFSDK_PAUSE_Adapter IPauseAdapter(pause);
+ pContext->m_pRenderer->Continue(&IPauseAdapter);
+ return CPDF_ProgressiveRenderer::ToFPDFStatus(
+ pContext->m_pRenderer->GetStatus());
+ }
+ return FPDF_RENDER_FAILED;
}
+DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page) {
+ if (!page)
+ return;
+
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CRenderContext* pContext = (CRenderContext*)pPage->GetPrivateData((void*)1);
+ if (!pContext)
+ return;
+
+ pContext->m_pDevice->RestoreState();
+ delete pContext;
+ pPage->RemovePrivateData((void*)1);
+}