summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-19 16:20:03 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-19 16:20:03 -0700
commitb3b67620b9db518558f2912357581b600645ce68 (patch)
treea54ffe1f3d15d492278fc53d7bd52e52af3a708b /fpdfsdk
parentd831dc7147e9895185740f551fed7abe246e2adf (diff)
downloadpdfium-b3b67620b9db518558f2912357581b600645ce68.tar.xz
Merge to XFA: Refactor progressive renderer.
Hand-application of diffs from https://codereview.chromium.org/1233453014/. This was an oversight, and was too old (pre-reformat) to apply cleanly. Checked against origin/master, only diffs are xfa related. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1416793002 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/src/fpdf_progressive.cpp13
-rw-r--r--fpdfsdk/src/fpdfview.cpp8
2 files changed, 7 insertions, 14 deletions
diff --git a/fpdfsdk/src/fpdf_progressive.cpp b/fpdfsdk/src/fpdf_progressive.cpp
index 4412648c8c..754974e6d6 100644
--- a/fpdfsdk/src/fpdf_progressive.cpp
+++ b/fpdfsdk/src/fpdf_progressive.cpp
@@ -50,10 +50,8 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap,
rotate, flags, FALSE, &IPauseAdapter);
if (pContext->m_pRenderer) {
- CPDF_ProgressiveRenderer::RenderStatus status =
- CPDF_ProgressiveRenderer::Failed;
- status = pContext->m_pRenderer->GetStatus();
- return status;
+ return CPDF_ProgressiveRenderer::ToFPDFStatus(
+ pContext->m_pRenderer->GetStatus());
}
return FPDF_RENDER_FAILED;
}
@@ -71,11 +69,8 @@ DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,
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 CPDF_ProgressiveRenderer::ToFPDFStatus(
+ pContext->m_pRenderer->GetStatus());
}
return FPDF_RENDER_FAILED;
}
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 8e794e1fd6..48c8de433f 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -856,14 +856,12 @@ void FPDF_RenderPage_Retail(CRenderContext* pContext,
&matrix, TRUE, NULL);
}
- pContext->m_pRenderer = new CPDF_ProgressiveRenderer;
- pContext->m_pRenderer->Start(pContext->m_pContext, pContext->m_pDevice,
- pContext->m_pOptions, pause);
+ pContext->m_pRenderer = new CPDF_ProgressiveRenderer(
+ pContext->m_pContext, pContext->m_pDevice, pContext->m_pOptions);
+ pContext->m_pRenderer->Start(pause);
if (bNeedToRestore) {
pContext->m_pDevice->RestoreState();
}
-
- //#endif
}
DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document,