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

Unified Diff: src/gpu/SkGr.cpp

Issue 1967743003: Minor GrRenderTarget retraction (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more clean up 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 | « src/gpu/GrYUVProvider.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index f1f48bc960e33095e52230c7a409c2ef29e027c8..120db1348cdb0b7752c399e40a82ea6bababd043 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -181,8 +181,8 @@ public:
}
};
-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 @@ GrTexture* GrUploadBitmapToTexture(GrContext* ctx, const SkBitmap& bitmap) {
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* GrGenerateMipMapsAndUploadToTexture(GrContext* ctx, const SkBitmap& b
}
}
- 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).
« no previous file with comments | « src/gpu/GrYUVProvider.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698