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

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 2003573002: Fix leak in SkImage_Gpu::onMakeSubset(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Gpu.cpp
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 2c2405839529f7aa27ffcef65536495542bd0490..f026ebcb378c89740bf8dcf1f82cee98a2566991 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -140,13 +140,13 @@ sk_sp<SkImage> SkImage_Gpu::onMakeSubset(const SkIRect& subset) const {
desc.fWidth = subset.width();
desc.fHeight = subset.height();
- GrTexture* subTx = ctx->textureProvider()->createTexture(desc, fBudgeted);
+ sk_sp<GrTexture> subTx(ctx->textureProvider()->createTexture(desc, fBudgeted));
if (!subTx) {
return nullptr;
}
- ctx->copySurface(subTx, fTexture, subset, SkIPoint::Make(0, 0));
+ ctx->copySurface(subTx.get(), fTexture, subset, SkIPoint::Make(0, 0));
return sk_make_sp<SkImage_Gpu>(desc.fWidth, desc.fHeight, kNeedNewImageUniqueID,
- fAlphaType, subTx, fBudgeted);
+ fAlphaType, subTx.get(), fBudgeted);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698