From b8642f8a3c3a6d359c4e319b8ba91f8df6448a4f Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 14 Dec 2016 19:48:47 -0800 Subject: More unique_ptr returns from DIB methods. Review-Url: https://codereview.chromium.org/2572293002 --- core/fxge/dib/fx_dib_main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '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 f90cbc1a91..8e6366d5c0 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_DIBSource::FlipImage(bool bXFlip, + bool bYFlip) const { + auto pFlipped = pdfium::MakeUnique(); + 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; -- cgit v1.2.3