Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: core/fpdfapi/render/cpdf_imagerenderer.cpp

Issue 2534953004: Return unique_ptrs from CFX_DIBitmap::Clone(). (Closed)
Patch Set: nits Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/render/cpdf_imagecacheentry.cpp ('k') | core/fpdfapi/render/cpdf_renderstatus.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/render/cpdf_imagerenderer.cpp
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp
index bdcd2b3c6517aa05591ef508fc7975092960d527..eae32443d864a8e0bc8f5a43528951218b84b391 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.cpp
+++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp
@@ -94,7 +94,7 @@ bool CPDF_ImageRenderer::StartRenderDIBSource() {
m_pImageObject->m_GeneralState.GetTransferFunc()->TranslateImage(
m_Loader.m_pBitmap, !m_Loader.m_bCached);
if (m_Loader.m_bCached && m_Loader.m_pMask)
- m_Loader.m_pMask = m_Loader.m_pMask->Clone();
+ m_Loader.m_pMask = m_Loader.m_pMask->Clone().release();
m_Loader.m_bCached = false;
}
}
@@ -110,7 +110,7 @@ bool CPDF_ImageRenderer::StartRenderDIBSource() {
}
m_FillArgb = m_pRenderStatus->GetFillArgb(m_pImageObject);
} else if (m_pRenderStatus->m_Options.m_ColorMode == RENDER_COLOR_GRAY) {
- m_pClone.reset(m_pDIBSource->Clone());
+ m_pClone = m_pDIBSource->Clone();
m_pClone->ConvertColorScale(m_pRenderStatus->m_Options.m_BackColor,
m_pRenderStatus->m_Options.m_ForeColor);
m_pDIBSource = m_pClone.get();
@@ -400,7 +400,7 @@ bool CPDF_ImageRenderer::StartDIBSource() {
}
}
#ifdef _SKIA_SUPPORT_
- CFX_DIBitmap* premultiplied = m_pDIBSource->Clone();
+ CFX_DIBitmap* premultiplied = m_pDIBSource->Clone().release();
if (m_pDIBSource->HasAlpha())
CFX_SkiaDeviceDriver::PreMultiply(premultiplied);
if (m_pRenderStatus->m_pDevice->StartDIBitsWithBlend(
« no previous file with comments | « core/fpdfapi/render/cpdf_imagecacheentry.cpp ('k') | core/fpdfapi/render/cpdf_renderstatus.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698