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

Unified Diff: core/fxge/win32/fx_win32_gdipext.cpp

Issue 2534953004: Return unique_ptrs from CFX_DIBitmap::Clone(). (Closed)
Patch Set: win again 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
Index: core/fxge/win32/fx_win32_gdipext.cpp
diff --git a/core/fxge/win32/fx_win32_gdipext.cpp b/core/fxge/win32/fx_win32_gdipext.cpp
index f3bf2deae26942b7f5aeed1f591964f1a21def30..e375f6f22880326e64748e26b910d15250266b93 100644
--- a/core/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/fxge/win32/fx_win32_gdipext.cpp
@@ -564,7 +564,8 @@ static void OutputImageMask(GpGraphics* pGraphics,
_StretchMonoToGray(dest_width, dest_height, pBitmap, &image_clip);
dsinclair 2016/12/05 20:41:26 Drop the _ from the method name
Tom Sepez 2016/12/05 21:38:13 Done.
} else {
pStretched =
- pBitmap->StretchTo(dest_width, dest_height, false, &image_clip);
+ pBitmap->StretchTo(dest_width, dest_height, false, &image_clip)
+ .release();
}
GpBitmap* bitmap;
CallFunc(GdipCreateBitmapFromScan0)(image_clip.Width(), image_clip.Height(),
@@ -610,7 +611,7 @@ static void OutputImage(GpGraphics* pGraphics,
((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
if (pBitmap->GetBPP() == 1 && (pSrcRect->left % 8)) {
FX_RECT new_rect(0, 0, src_width, src_height);
- CFX_DIBitmap* pCloned = pBitmap->Clone(pSrcRect);
+ CFX_DIBitmap* pCloned = pBitmap->Clone(pSrcRect).release();
dsinclair 2016/12/05 20:41:26 unique_ptr?
if (!pCloned) {
npm 2016/12/05 20:37:23 Nit: no {}
return;
}

Powered by Google App Engine
This is Rietveld 408576698