summaryrefslogtreecommitdiff
path: root/core/fxge/agg
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge/agg')
-rw-r--r--core/fxge/agg/fx_agg_driver.cpp21
-rw-r--r--core/fxge/agg/fx_agg_driver.h5
2 files changed, 8 insertions, 18 deletions
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index 031246b494..a04d716b8f 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -1650,29 +1650,20 @@ bool CFX_AggDeviceDriver::StartDIBits(
uint32_t argb,
const CFX_Matrix* pMatrix,
uint32_t render_flags,
- void*& handle,
+ std::unique_ptr<CFX_ImageRenderer>* handle,
int blend_type) {
if (!m_pBitmap->GetBuffer())
return true;
- CFX_ImageRenderer* pRenderer = new CFX_ImageRenderer;
- pRenderer->Start(m_pBitmap, m_pClipRgn.get(), pSource, bitmap_alpha, argb,
+ *handle = pdfium::MakeUnique<CFX_ImageRenderer>();
+ (*handle)->Start(m_pBitmap, m_pClipRgn.get(), pSource, bitmap_alpha, argb,
pMatrix, render_flags, m_bRgbByteOrder, 0, nullptr);
- handle = pRenderer;
return true;
}
-bool CFX_AggDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause) {
- return m_pBitmap->GetBuffer()
- ? reinterpret_cast<CFX_ImageRenderer*>(pHandle)->Continue(pPause)
- : true;
-}
-
-void CFX_AggDeviceDriver::CancelDIBits(void* pHandle) {
- if (!m_pBitmap->GetBuffer())
- return;
-
- delete reinterpret_cast<CFX_ImageRenderer*>(pHandle);
+bool CFX_AggDeviceDriver::ContinueDIBits(CFX_ImageRenderer* pHandle,
+ IFX_Pause* pPause) {
+ return m_pBitmap->GetBuffer() ? pHandle->Continue(pPause) : true;
}
#ifndef _SKIA_SUPPORT_
diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h
index 723ed6d98a..3eb56c507e 100644
--- a/core/fxge/agg/fx_agg_driver.h
+++ b/core/fxge/agg/fx_agg_driver.h
@@ -87,10 +87,9 @@ class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver {
uint32_t color,
const CFX_Matrix* pMatrix,
uint32_t flags,
- void*& handle,
+ std::unique_ptr<CFX_ImageRenderer>* handle,
int blend_type) override;
- bool ContinueDIBits(void* handle, IFX_Pause* pPause) override;
- void CancelDIBits(void* handle) override;
+ bool ContinueDIBits(CFX_ImageRenderer* handle, IFX_Pause* pPause) override;
bool DrawDeviceText(int nChars,
const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont,