From 72c1bda4efaf0121e13b794cb886acd9806b6c89 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 14 Dec 2016 14:15:14 -0800 Subject: Return unique_ptr from GetAlphaMask. Rename GetAlphaMask => CloneAlphaMask since it does more than get. Rename CopyAlphaMask => SetAlphaMask, as it copies IN, not OUT. ditto for CopyPalette => SetPalette. BUG= Review-Url: https://codereview.chromium.org/2572243002 --- core/fxge/fx_dib.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'core/fxge/fx_dib.h') diff --git a/core/fxge/fx_dib.h b/core/fxge/fx_dib.h index ed2b47f9c1..c083bf732f 100644 --- a/core/fxge/fx_dib.h +++ b/core/fxge/fx_dib.h @@ -213,7 +213,8 @@ class CFX_DIBSource { SetPaletteEntry(index, color); } - void CopyPalette(const uint32_t* pSrcPal); + // Copies into internally-owned palette. + void SetPalette(const uint32_t* pSrcPal); std::unique_ptr Clone(const FX_RECT* pClip = nullptr) const; std::unique_ptr CloneConvert(FXDIB_Format format) const; @@ -229,9 +230,12 @@ class CFX_DIBSource { uint32_t flags = 0, const FX_RECT* pClip = nullptr) const; - CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = nullptr) const; - bool CopyAlphaMask(const CFX_DIBSource* pAlphaMask, - const FX_RECT* pClip = nullptr); + std::unique_ptr CloneAlphaMask( + const FX_RECT* pClip = nullptr) const; + + // Copies into internally-owned mask. + bool SetAlphaMask(const CFX_DIBSource* pAlphaMask, + const FX_RECT* pClip = nullptr); CFX_DIBitmap* SwapXY(bool bXFlip, bool bYFlip, -- cgit v1.2.3