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

Unified Diff: core/fxge/dib/fx_dib_main.cpp

Issue 2572293002: More unique_ptr returns from DIB methods. (Closed)
Patch Set: win build 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 | « no previous file | core/fxge/dib/fx_dib_transform.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/dib/fx_dib_main.cpp
diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp
index f90cbc1a91b07eb73e122af3af6f966fe15fcc98..8e6366d5c0bc759ed98705406a25ece9cca25ed7 100644
--- a/core/fxge/dib/fx_dib_main.cpp
+++ b/core/fxge/dib/fx_dib_main.cpp
@@ -1342,12 +1342,12 @@ bool CFX_DIBitmap::ConvertColorScale(uint32_t forecolor, uint32_t backcolor) {
return true;
}
-CFX_DIBitmap* CFX_DIBSource::FlipImage(bool bXFlip, bool bYFlip) const {
- CFX_DIBitmap* pFlipped = new CFX_DIBitmap;
- if (!pFlipped->Create(m_Width, m_Height, GetFormat())) {
- delete pFlipped;
+std::unique_ptr<CFX_DIBitmap> CFX_DIBSource::FlipImage(bool bXFlip,
+ bool bYFlip) const {
+ auto pFlipped = pdfium::MakeUnique<CFX_DIBitmap>();
+ if (!pFlipped->Create(m_Width, m_Height, GetFormat()))
return nullptr;
- }
+
pFlipped->SetPalette(m_pPalette.get());
uint8_t* pDestBuffer = pFlipped->GetBuffer();
int Bpp = m_bpp / 8;
« no previous file with comments | « no previous file | core/fxge/dib/fx_dib_transform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698