Move ReleaseProc info to GrTexture and for implementations to define it.
Bug: skia:
Change-Id: I0dbe421ebd17ef7d21fd2f4f027d2a3bdcf04b7b
Reviewed-on: https://skia-review.googlesource.com/14031
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/vk/GrVkResource.h b/src/gpu/vk/GrVkResource.h
index 9d7212e..9ddde47 100644
--- a/src/gpu/vk/GrVkResource.h
+++ b/src/gpu/vk/GrVkResource.h
@@ -31,7 +31,7 @@
This is nearly identical to SkRefCntBase. The exceptions are that unref()
takes a GrVkGpu, and any derived classes must implement freeGPUData() and
- possibly abandonSubResources().
+ possibly abandonGPUData().
*/
class GrVkResource : SkNoncopyable {
@@ -153,10 +153,12 @@
*/
virtual void freeGPUData(const GrVkGpu* gpu) const = 0;
- /** Must be overridden by subclasses that themselves store GrVkResources.
- * Will unrefAndAbandon those resources without deleting the underlying Vk data
+ /**
+ * Called from unrefAndAbandon. Resources should do any necessary cleanup without freeing
+ * underlying Vk objects. This must be overridden by subclasses that themselves store
+ * GrVkResources since those resource will need to be unrefed.
*/
- virtual void abandonSubResources() const {}
+ virtual void abandonGPUData() const {}
/**
* Called when the ref count goes to 0. Will free Vk resources.
@@ -175,7 +177,7 @@
* Internal_dispose without freeing Vk resources. Used when we've lost context.
*/
void internal_dispose() const {
- this->abandonSubResources();
+ this->abandonGPUData();
#ifdef SK_TRACE_VK_RESOURCES
fTrace.remove(this);
#endif