Minor GrRenderTarget retraction
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1967743003
Review-Url: https://codereview.chromium.org/1967743003
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index f1f48bc..120db13 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -181,8 +181,8 @@
}
};
-static GrTexture* create_texture_from_yuv(GrContext* ctx, const SkBitmap& bm,
- const GrSurfaceDesc& desc) {
+static sk_sp<GrTexture> create_texture_from_yuv(GrContext* ctx, const SkBitmap& bm,
+ const GrSurfaceDesc& desc) {
// Subsets are not supported, the whole pixelRef is loaded when using YUV decoding
SkPixelRef* pixelRef = bm.pixelRef();
if ((nullptr == pixelRef) ||
@@ -218,8 +218,9 @@
return texture;
}
- if (GrTexture* texture = create_texture_from_yuv(ctx, bitmap, desc)) {
- return texture;
+ sk_sp<GrTexture> texture(create_texture_from_yuv(ctx, bitmap, desc));
+ if (texture) {
+ return texture.release();
}
SkAutoLockPixels alp(bitmap);
@@ -339,9 +340,9 @@
}
}
- GrTexture* texture = create_texture_from_yuv(ctx, bitmap, desc);
+ sk_sp<GrTexture> texture(create_texture_from_yuv(ctx, bitmap, desc));
if (texture) {
- return texture;
+ return texture.release();
}
// SkMipMap::Build doesn't handle sRGB data correctly (yet).