summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_progressive.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-07-24 08:08:24 -0700
committerCommit bot <commit-bot@chromium.org>2016-07-24 08:08:24 -0700
commit9f515bcccb40e8ae251bbe8afc1ef6c4db1f05a8 (patch)
tree83db93367d20abf65f8b4eb459f54d9f60a05732 /fpdfsdk/fpdf_progressive.cpp
parent8f19e4bc617d19e871137be55a34992e421585ad (diff)
downloadpdfium-9f515bcccb40e8ae251bbe8afc1ef6c4db1f05a8.tar.xz
Use actual type instead CFX_Deletable
Change two places that used CFX_Deletable to use actual types. This makes the type more obvious, and avoids unnecessary casts. Review-Url: https://codereview.chromium.org/2180443002
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>());
}