Migrate GrResourceAllocator::fIntvlHash to SkTHashMap
SkTDynamicHash is semi-deprecated and this simplifies life a little bit.
Bug: skia:10877
Change-Id: Ie64f476fcab0a53d8cb8044fe4c68571bc0d2a66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384857
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
diff --git a/src/gpu/GrResourceAllocator.cpp b/src/gpu/GrResourceAllocator.cpp
index ca8e1d7..f271f4e 100644
--- a/src/gpu/GrResourceAllocator.cpp
+++ b/src/gpu/GrResourceAllocator.cpp
@@ -72,7 +72,9 @@
}
return;
}
- if (Interval* intvl = fIntvlHash.find(proxy->uniqueID().asUInt())) {
+ uint32_t proxyID = proxy->uniqueID().asUInt();
+ if (Interval** intvlPtr = fIntvlHash.find(proxyID)) {
+ Interval* intvl = *intvlPtr;
// Revise the interval for an existing use
#ifdef SK_DEBUG
if (0 == start && 0 == end) {
@@ -100,7 +102,7 @@
newIntvl->addUse();
}
fIntvlList.insertByIncreasingStart(newIntvl);
- fIntvlHash.add(newIntvl);
+ fIntvlHash.set(proxyID, newIntvl);
}
GrResourceAllocator::Interval* GrResourceAllocator::IntervalList::popHead() {