summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_progressive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdf_progressive.cpp')
-rw-r--r--fpdfsdk/fpdf_progressive.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp
index efde1eb029..2912e8b6c3 100644
--- a/fpdfsdk/fpdf_progressive.cpp
+++ b/fpdfsdk/fpdf_progressive.cpp
@@ -8,9 +8,11 @@
#include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
#include "core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h"
+#include "core/fpdfapi/include/cpdf_pagerendercontext.h"
+#include "core/fxcrt/include/fx_memory.h"
#include "core/fxge/include/fx_ge.h"
#include "fpdfsdk/include/fsdk_define.h"
-#include "fpdfsdk/include/fsdk_rendercontext.h"
+#include "fpdfsdk/include/fsdk_pauseadapter.h"
#include "public/fpdfview.h"
// These checks are here because core/ and public/ cannot depend on each other.
@@ -40,10 +42,10 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap,
if (!pPage)
return FPDF_RENDER_FAILED;
- CRenderContext* pContext = new CRenderContext;
- pPage->SetRenderContext(std::unique_ptr<CFX_Deletable>(pContext));
+ CPDF_PageRenderContext* pContext = new CPDF_PageRenderContext;
+ pPage->SetRenderContext(WrapUnique(pContext));
CFX_FxgeDevice* pDevice = new CFX_FxgeDevice;
- pContext->m_pDevice = pDevice;
+ pContext->m_pDevice.reset(pDevice);
CFX_DIBitmap* pBitmap = CFXBitmapFromFPDFBitmap(bitmap);
pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
@@ -67,8 +69,7 @@ DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,
if (!pPage)
return FPDF_RENDER_FAILED;
- CRenderContext* pContext =
- static_cast<CRenderContext*>(pPage->GetRenderContext());
+ CPDF_PageRenderContext* pContext = pPage->GetRenderContext();
if (pContext && pContext->m_pRenderer) {
IFSDK_PAUSE_Adapter IPauseAdapter(pause);
pContext->m_pRenderer->Continue(&IPauseAdapter);
@@ -83,11 +84,10 @@ DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page) {
if (!pPage)
return;
- CRenderContext* pContext =
- static_cast<CRenderContext*>(pPage->GetRenderContext());
+ CPDF_PageRenderContext* pContext = pPage->GetRenderContext();
if (!pContext)
return;
pContext->m_pDevice->RestoreState(false);
- pPage->SetRenderContext(std::unique_ptr<CFX_Deletable>());
+ pPage->SetRenderContext(std::unique_ptr<CPDF_PageRenderContext>());
}