summaryrefslogtreecommitdiff
path: root/core/fxge/fx_dib.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-06 06:29:28 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-06 06:29:28 -0800
commit1a1d7648d3e338b756e464cebb2ae1a815359afa (patch)
treedefa2de6d2cb61efd95ef212eb3e89e1a5811032 /core/fxge/fx_dib.h
parent7341149c634e0ab9a619898826440f6e952cf0aa (diff)
downloadpdfium-1a1d7648d3e338b756e464cebb2ae1a815359afa.tar.xz
Return unique_ptrs from CFX_DIBitmap::Clone().
Because that's what clone does. Perform immediate release in some spots to avoid disrupting too much at once. Review-Url: https://codereview.chromium.org/2534953004
Diffstat (limited to 'core/fxge/fx_dib.h')
-rw-r--r--core/fxge/fx_dib.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/core/fxge/fx_dib.h b/core/fxge/fx_dib.h
index 1719ae13e5..ed2b47f9c1 100644
--- a/core/fxge/fx_dib.h
+++ b/core/fxge/fx_dib.h
@@ -215,18 +215,19 @@ class CFX_DIBSource {
void CopyPalette(const uint32_t* pSrcPal);
- CFX_DIBitmap* Clone(const FX_RECT* pClip = nullptr) const;
- CFX_DIBitmap* CloneConvert(FXDIB_Format format) const;
-
- CFX_DIBitmap* StretchTo(int dest_width,
- int dest_height,
- uint32_t flags = 0,
- const FX_RECT* pClip = nullptr) const;
- CFX_DIBitmap* TransformTo(const CFX_Matrix* pMatrix,
- int& left,
- int& top,
- uint32_t flags = 0,
- const FX_RECT* pClip = nullptr) const;
+ std::unique_ptr<CFX_DIBitmap> Clone(const FX_RECT* pClip = nullptr) const;
+ std::unique_ptr<CFX_DIBitmap> CloneConvert(FXDIB_Format format) const;
+
+ std::unique_ptr<CFX_DIBitmap> StretchTo(int dest_width,
+ int dest_height,
+ uint32_t flags = 0,
+ const FX_RECT* pClip = nullptr) const;
+ std::unique_ptr<CFX_DIBitmap> TransformTo(
+ const CFX_Matrix* pMatrix,
+ int& left,
+ int& top,
+ 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,
@@ -307,14 +308,14 @@ class CFX_DIBitmap : public CFX_DIBSource {
void SetPixel(int x, int y, uint32_t color);
bool LoadChannel(FXDIB_Channel destChannel,
- const CFX_DIBSource* pSrcBitmap,
+ CFX_DIBSource* pSrcBitmap,
FXDIB_Channel srcChannel);
bool LoadChannel(FXDIB_Channel destChannel, int value);
bool MultiplyAlpha(int alpha);
- bool MultiplyAlpha(const CFX_DIBSource* pAlphaMask);
+ bool MultiplyAlpha(CFX_DIBSource* pAlphaMask);
bool TransferBitmap(int dest_left,
int dest_top,