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

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

Issue 2534953004: Return unique_ptrs from CFX_DIBitmap::Clone(). (Closed)
Patch Set: nits 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 | « core/fxge/dib/fx_dib_main.cpp ('k') | core/fxge/fx_dib.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/dib/fx_dib_transform.cpp
diff --git a/core/fxge/dib/fx_dib_transform.cpp b/core/fxge/dib/fx_dib_transform.cpp
index b938d648a89250bdf28c7c1cef9cb8963df8e2fc..dacc0aa393bd025884255d87abef3a91380321f7 100644
--- a/core/fxge/dib/fx_dib_transform.cpp
+++ b/core/fxge/dib/fx_dib_transform.cpp
@@ -301,23 +301,25 @@ FX_RECT FXDIB_SwapClipBox(FX_RECT& clip,
return rect;
}
-CFX_DIBitmap* CFX_DIBSource::TransformTo(const CFX_Matrix* pDestMatrix,
- int& result_left,
- int& result_top,
- uint32_t flags,
- const FX_RECT* pDestClip) const {
+std::unique_ptr<CFX_DIBitmap> CFX_DIBSource::TransformTo(
+ const CFX_Matrix* pDestMatrix,
+ int& result_left,
+ int& result_top,
+ uint32_t flags,
+ const FX_RECT* pDestClip) const {
CFX_ImageTransformer transformer(this, pDestMatrix, flags, pDestClip);
transformer.Start();
transformer.Continue(nullptr);
result_left = transformer.result().left;
result_top = transformer.result().top;
- return transformer.DetachBitmap().release();
+ return transformer.DetachBitmap();
}
-CFX_DIBitmap* CFX_DIBSource::StretchTo(int dest_width,
- int dest_height,
- uint32_t flags,
- const FX_RECT* pClip) const {
+std::unique_ptr<CFX_DIBitmap> CFX_DIBSource::StretchTo(
+ int dest_width,
+ int dest_height,
+ uint32_t flags,
+ const FX_RECT* pClip) const {
FX_RECT clip_rect(0, 0, FXSYS_abs(dest_width), FXSYS_abs(dest_height));
if (pClip)
clip_rect.Intersect(*pClip);
@@ -333,7 +335,8 @@ CFX_DIBitmap* CFX_DIBSource::StretchTo(int dest_width,
clip_rect, flags);
if (stretcher.Start())
stretcher.Continue(nullptr);
- return storer.Detach().release();
+
+ return storer.Detach();
}
CFX_ImageTransformer::CFX_ImageTransformer(const CFX_DIBSource* pSrc,
« no previous file with comments | « core/fxge/dib/fx_dib_main.cpp ('k') | core/fxge/fx_dib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698