Yet more GrThreadSafeUniquelyKeyedProxyViewCache purging tests

This CL also renames dropAllUniqueRefs

Bug: 1108408
Change-Id: Ic39ccfc5efafd60d53524562dd308102fb134d94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318737
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrThreadSafeUniquelyKeyedProxyViewCache.h b/src/gpu/GrThreadSafeUniquelyKeyedProxyViewCache.h
index 1093bae..34ee704 100644
--- a/src/gpu/GrThreadSafeUniquelyKeyedProxyViewCache.h
+++ b/src/gpu/GrThreadSafeUniquelyKeyedProxyViewCache.h
@@ -48,6 +48,15 @@
 //    to purge the requested amount of resources fails, uniquely held resources in this cache
 //    will be dropped in LRU to MRU order until the cache is under budget. Note that this
 //    prioritizes the survival of resources in this cache over those just in the resource cache.
+//
+//    For the 'scratchResourcesOnly' variant of GrContext::purgeUnlockedResources, this cache
+//    won't be modified in the scratch-only case unless the resource cache is over budget (in
+//    which case it will purge uniquely-held resources in LRU to MRU order to get
+//    back under budget). In the non-scratch-only case, all uniquely held resources in this cache
+//    will be released prior to the resource cache being cleared out.
+//
+//    For GrContext::setResourceCacheLimit, if an initial pass through the resource cache doesn't
+//    reach the budget, uniquely held resources in this cache will be released in LRU to MRU order.
 class GrThreadSafeUniquelyKeyedProxyViewCache {
 public:
     GrThreadSafeUniquelyKeyedProxyViewCache();
@@ -60,7 +69,10 @@
 #endif
 
     void dropAllRefs()  SK_EXCLUDES(fSpinLock);
-    void dropAllUniqueRefs(GrResourceCache* resourceCache)  SK_EXCLUDES(fSpinLock);
+
+    // Drop uniquely held refs subject to some requirement (e.g., budget, time last accessed).
+    // A null parameter means drop all uniquely held refs
+    void dropUniqueRefs(GrResourceCache* resourceCache)  SK_EXCLUDES(fSpinLock);
 
     GrSurfaceProxyView find(const GrUniqueKey&)  SK_EXCLUDES(fSpinLock);