Hoist GrVkResource up so it can be used for D3D and Metal.

Bug: skia:9935
Change-Id: Ie13b9077c5db805020973e5cbab1aa8468c88742
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276214
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/vk/GrVkCommandPool.cpp b/src/gpu/vk/GrVkCommandPool.cpp
index 95b90d9..adc25a6 100644
--- a/src/gpu/vk/GrVkCommandPool.cpp
+++ b/src/gpu/vk/GrVkCommandPool.cpp
@@ -86,19 +86,20 @@
     fPrimaryCommandBuffer->recycleSecondaryCommandBuffers(this);
 }
 
-void GrVkCommandPool::freeGPUData(GrVkGpu* gpu) const {
-    // TODO: having freeGPUData virtual on GrVkResource be const seems like a bad restriction since
+void GrVkCommandPool::freeGPUData(GrGpu* gpu) const {
+    // TODO: having freeGPUData virtual on GrManagedResource be const seems like a bad restriction since
     // we are changing the internal objects of these classes when it is called. We should go back a
     // revisit how much of a headache it would be to make this function non-const
+    GrVkGpu* vkGpu = (GrVkGpu*)gpu;
     GrVkCommandPool* nonConstThis = const_cast<GrVkCommandPool*>(this);
     nonConstThis->close();
-    nonConstThis->releaseResources(gpu);
+    nonConstThis->releaseResources(vkGpu);
     fPrimaryCommandBuffer->freeGPUData(gpu, fCommandPool);
     for (const auto& buffer : fAvailableSecondaryBuffers) {
         buffer->freeGPUData(gpu, fCommandPool);
     }
     if (fCommandPool != VK_NULL_HANDLE) {
-        GR_VK_CALL(gpu->vkInterface(),
-                   DestroyCommandPool(gpu->device(), fCommandPool, nullptr));
+        GR_VK_CALL(vkGpu->vkInterface(),
+                   DestroyCommandPool(vkGpu->device(), fCommandPool, nullptr));
     }
 }