Use GrSurface::setRelease helper that creates ref-counted wrapper Change-Id: Ic748ee18d6cdf7d7b83a89ad6ec580be96bc305b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197769 Commit-Queue: Robert Phillips <robertphillips@google.com> Auto-Submit: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp index 2540cbb..d65320a 100644 --- a/src/gpu/GrProxyProvider.cpp +++ b/src/gpu/GrProxyProvider.cpp
@@ -557,11 +557,8 @@ return nullptr; } - sk_sp<GrRefCntedCallback> releaseHelper; if (releaseProc) { - releaseHelper.reset(new GrRefCntedCallback(releaseProc, releaseCtx)); - // This gives the render target a ref on the releaseHelper - rt->setRelease(std::move(releaseHelper)); + rt->setRelease(releaseProc, releaseCtx); } SkASSERT(!rt->asTexture()); // A GrRenderTarget that's not textureable
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp index 503652c..9035cd7 100644 --- a/tests/GrSurfaceTest.cpp +++ b/tests/GrSurfaceTest.cpp
@@ -361,8 +361,7 @@ } delete releaseContext; }; - texture->setRelease( - sk_make_sp<GrRefCntedCallback>(release, new ReleaseContext{context, backendTexture})); + texture->setRelease(release, new ReleaseContext{context, backendTexture}); return texture; }