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/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index 7c5a640..a4e61c0 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -530,7 +530,7 @@
     }
 
     if (stillOverbudget) {
-        fThreadSafeViewCache->dropAllUniqueRefs(this);
+        fThreadSafeViewCache->dropUniqueRefs(this);
 
         while (stillOverbudget && fPurgeableQueue.count()) {
             GrGpuResource* resource = fPurgeableQueue.peek();
@@ -544,11 +544,10 @@
 }
 
 void GrResourceCache::purgeUnlockedResources(bool scratchResourcesOnly) {
-    // In the scratch-only mode we could just drop the ones that are uniquely held and would
-    // be converted to scratch textures
-    fThreadSafeViewCache->dropAllUniqueRefs(nullptr);
 
     if (!scratchResourcesOnly) {
+        fThreadSafeViewCache->dropUniqueRefs(nullptr);
+
         // We could disable maintaining the heap property here, but it would add a lot of
         // complexity. Moreover, this is rarely called.
         while (fPurgeableQueue.count()) {