Use HashSet instead of Dynamic hash for tracking vulkan resources

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2194823003

Review-Url: https://codereview.chromium.org/2194823003
diff --git a/src/gpu/vk/GrVkResource.h b/src/gpu/vk/GrVkResource.h
index fde3e37..9d7212e 100644
--- a/src/gpu/vk/GrVkResource.h
+++ b/src/gpu/vk/GrVkResource.h
@@ -9,8 +9,8 @@
 #define GrVkResource_DEFINED
 
 #include "SkAtomics.h"
-#include "SkTDynamicHash.h"
 #include "SkRandom.h"
+#include "SkTHash.h"
 
 class GrVkGpu;
 
@@ -38,25 +38,26 @@
 public:
     // Simple refCount tracing, to ensure that everything ref'ed is unref'ed.
 #ifdef SK_TRACE_VK_RESOURCES
-    static const uint32_t& GetKey(const GrVkResource& r) { return r.fKey; }
-    static uint32_t Hash(const uint32_t& k) { return k; }
+    struct Hash {
+        uint32_t operator()(const GrVkResource* const& r) const {
+            SkASSERT(r);
+            return r->fKey;
+        }
+    };
 
     class Trace {
     public:
         ~Trace() {
-            if (fHash.count()) {
-                SkTDynamicHash<GrVkResource, uint32_t>::Iter iter(&fHash);
-                for (; !iter.done(); ++iter) {
-                    (*iter).dumpInfo();
-                }
-            }
-            SkASSERT(0 == fHash.count());
+            fHashSet.foreach([](const GrVkResource* r) {
+                r->dumpInfo();
+            });
+            SkASSERT(0 == fHashSet.count());
         }
-        void add(GrVkResource* r) { fHash.add(r); }
-        void remove(const GrVkResource* r) { fHash.remove(GetKey(*r)); }
+        void add(const GrVkResource* r) { fHashSet.add(r); }
+        void remove(const GrVkResource* r) { fHashSet.remove(r); }
 
     private:
-        SkTDynamicHash<GrVkResource, uint32_t> fHash;
+        SkTHashSet<const GrVkResource*, GrVkResource::Hash> fHashSet;
     };
     static Trace  fTrace;