Add ref counted wrapped around GrTexture ReleaseProc
Bug: skia:
Change-Id: I0cd11a539fd6b16d4b3f9512694f84e0a429518c
Reviewed-on: https://skia-review.googlesource.com/101341
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrAHardwareBufferImageGenerator.cpp b/src/gpu/GrAHardwareBufferImageGenerator.cpp
index 74073ad..085d27a 100644
--- a/src/gpu/GrAHardwareBufferImageGenerator.cpp
+++ b/src/gpu/GrAHardwareBufferImageGenerator.cpp
@@ -229,7 +229,10 @@
eglDestroyImageKHR(display, image);
return nullptr;
}
- tex->setRelease(deleteImageTexture, new BufferCleanupHelper(image, display));
+ sk_sp<GrReleaseProcHelper> releaseHelper(
+ new GrReleaseProcHelper(deleteImageTexture, new BufferCleanupHelper(image, display)));
+
+ tex->setRelease(std::move(releaseHelper));
// We fail this assert, if the context has changed. This will be fully handled after
// skbug.com/6812 is ready.