Deuninstantiate

Uninstantiated: a state of not being instantiated.

Deinstantiate: transition from instantiated to uninstantiated state.

Change-Id: Id7b6b295267674a9915f95105d73fabfcc3555de
Reviewed-on: https://skia-review.googlesource.com/c/175586
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/gn/gpu.gni b/gn/gpu.gni
index 25404e5..51d5728 100644
--- a/gn/gpu.gni
+++ b/gn/gpu.gni
@@ -78,6 +78,8 @@
   "$_src/gpu/GrDefaultGeoProcFactory.h",
   "$_src/gpu/GrDeferredProxyUploader.h",
   "$_src/gpu/GrDeferredUpload.h",
+  "$_src/gpu/GrDeinstantiateProxyTracker.cpp",
+  "$_src/gpu/GrDeinstantiateProxyTracker.h",
   "$_src/gpu/GrDirectContext.cpp",
   "$_src/gpu/GrDistanceFieldGenFromVector.cpp",
   "$_src/gpu/GrDistanceFieldGenFromVector.h",
@@ -216,8 +218,6 @@
   "$_src/gpu/GrTextureRenderTargetProxy.cpp",
   "$_src/gpu/GrTextureRenderTargetProxy.h",
   "$_src/gpu/GrTRecorder.h",
-  "$_src/gpu/GrUninstantiateProxyTracker.cpp",
-  "$_src/gpu/GrUninstantiateProxyTracker.h",
   "$_src/gpu/GrUserStencilSettings.h",
   "$_src/gpu/GrWindowRectangles.h",
   "$_src/gpu/GrWindowRectsState.h",
diff --git a/include/private/GrOpList.h b/include/private/GrOpList.h
index e596ca9..4b1d0e3 100644
--- a/include/private/GrOpList.h
+++ b/include/private/GrOpList.h
@@ -121,7 +121,7 @@
     SkDEBUGCODE(void validate() const);
     void closeThoseWhoDependOnMe(const GrCaps&);
 
-    // Remove all Ops which reference proxies that have not been instantiated.
+    // Remove all Ops which reference proxies that are not instantiated.
     virtual void purgeOpsWithUninstantiatedProxies() = 0;
 
     // Feed proxy usage intervals to the GrResourceAllocator class
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index 73908bf..feaf2b7 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -205,10 +205,10 @@
 class GrSurfaceProxy : public GrIORefProxy {
 public:
     enum class LazyInstantiationType {
-        kSingleUse,         // Instantiation callback is allowed to be called only once
-        kMultipleUse,       // Instantiation callback can be called multiple times.
-        kUninstantiate,     // Instantiation callback can be called multiple times,
-                            // but we will uninstantiate the proxy after every flush
+        kSingleUse,      // Instantiation callback is allowed to be called only once.
+        kMultipleUse,    // Instantiation callback can be called multiple times.
+        kDeinstantiate,  // Instantiation callback can be called multiple times,
+                         // but we will deinstantiate the proxy after every flush.
     };
 
     enum class LazyState {
@@ -325,7 +325,7 @@
 
     virtual bool instantiate(GrResourceProvider* resourceProvider) = 0;
 
-    void deInstantiate();
+    void deinstantiate();
 
     /**
      * Proxies that are already instantiated and whose backing surface cannot be recycled to
diff --git a/src/gpu/GrUninstantiateProxyTracker.cpp b/src/gpu/GrDeinstantiateProxyTracker.cpp
similarity index 65%
rename from src/gpu/GrUninstantiateProxyTracker.cpp
rename to src/gpu/GrDeinstantiateProxyTracker.cpp
index 2bd5e3d..9870617 100644
--- a/src/gpu/GrUninstantiateProxyTracker.cpp
+++ b/src/gpu/GrDeinstantiateProxyTracker.cpp
@@ -5,15 +5,15 @@
  * found in the LICENSE file.
  */
 
-#include "GrUninstantiateProxyTracker.h"
+#include "GrDeinstantiateProxyTracker.h"
 
 #include "GrSurfaceProxy.h"
 #include "GrSurfaceProxyPriv.h"
 
-void GrUninstantiateProxyTracker::addProxy(GrSurfaceProxy* proxy) {
+void GrDeinstantiateProxyTracker::addProxy(GrSurfaceProxy* proxy) {
 #ifdef SK_DEBUG
     using LazyType = GrSurfaceProxy::LazyInstantiationType;
-    SkASSERT(LazyType::kUninstantiate == proxy->priv().lazyInstantiationType());
+    SkASSERT(LazyType::kDeinstantiate == proxy->priv().lazyInstantiationType());
     for (int i = 0; i < fProxies.count(); ++i) {
         SkASSERT(proxy != fProxies[i].get());
     }
@@ -21,11 +21,11 @@
     fProxies.push_back(sk_ref_sp(proxy));
 }
 
-void GrUninstantiateProxyTracker::uninstantiateAllProxies() {
+void GrDeinstantiateProxyTracker::deinstantiateAllProxies() {
     for (int i = 0; i < fProxies.count(); ++i) {
         GrSurfaceProxy* proxy = fProxies[i].get();
-        SkASSERT(proxy->priv().isSafeToUninstantiate());
-        proxy->deInstantiate();
+        SkASSERT(proxy->priv().isSafeToDeinstantiate());
+        proxy->deinstantiate();
     }
 
     fProxies.reset();
diff --git a/src/gpu/GrDeinstantiateProxyTracker.h b/src/gpu/GrDeinstantiateProxyTracker.h
new file mode 100644
index 0000000..2555ab1
--- /dev/null
+++ b/src/gpu/GrDeinstantiateProxyTracker.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2018 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrDeinstantiateProxyTracker_DEFINED
+#define GrDeinstantiateProxyTracker_DEFINED
+
+#include "GrSurfaceProxy.h"
+#include "SkTArray.h"
+
+class GrDeinstantiateProxyTracker {
+public:
+    GrDeinstantiateProxyTracker() {}
+
+    // Adds a proxy which will be deinstantiated at the end of flush. The same proxy may not be
+    // added multiple times.
+    void addProxy(GrSurfaceProxy* proxy);
+
+    // Loops through all tracked proxies and deinstantiates them.
+    void deinstantiateAllProxies();
+
+private:
+    SkTArray<sk_sp<GrSurfaceProxy>> fProxies;
+};
+
+#endif
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index edfd3c2..add0601 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -593,7 +593,7 @@
     }
 
     // remove ref to the backing texture
-    fProxies[lastPageIndex]->deInstantiate();
+    fProxies[lastPageIndex]->deinstantiate();
     --fNumActivePages;
 }
 
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 79e1684..b0143ae 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -284,7 +284,7 @@
 
     {
         GrResourceAllocator alloc(fContext->contextPriv().resourceProvider(),
-                                  flushState.uninstantiateProxyTracker());
+                                  flushState.deinstantiateProxyTracker());
         for (int i = 0; i < fDAG.numOpLists(); ++i) {
             if (fDAG.opList(i)) {
                 fDAG.opList(i)->gatherProxyIntervals(&alloc);
@@ -333,7 +333,7 @@
 
     GrSemaphoresSubmitted result = gpu->finishFlush(numSemaphores, backendSemaphores);
 
-    flushState.uninstantiateProxyTracker()->uninstantiateAllProxies();
+    flushState.deinstantiateProxyTracker()->deinstantiateAllProxies();
 
     // Give the cache a chance to purge resources that become purgeable due to flushing.
     if (flushed) {
diff --git a/src/gpu/GrOnFlushResourceProvider.cpp b/src/gpu/GrOnFlushResourceProvider.cpp
index bbf1029..2555c81 100644
--- a/src/gpu/GrOnFlushResourceProvider.cpp
+++ b/src/gpu/GrOnFlushResourceProvider.cpp
@@ -60,7 +60,7 @@
     auto resourceProvider = fDrawingMgr->getContext()->contextPriv().resourceProvider();
 
     if (GrSurfaceProxy::LazyState::kNot != proxy->lazyInstantiationState()) {
-        // DDL TODO: Decide if we ever plan to have these proxies use the GrUninstantiateTracker
+        // DDL TODO: Decide if we ever plan to have these proxies use the GrDeinstantiateTracker
         // to support unistantiating them at the end of a flush.
         return proxy->priv().doLazyInstantiation(resourceProvider);
     }
diff --git a/src/gpu/GrOpFlushState.h b/src/gpu/GrOpFlushState.h
index 1e44935..f963c69 100644
--- a/src/gpu/GrOpFlushState.h
+++ b/src/gpu/GrOpFlushState.h
@@ -12,7 +12,7 @@
 #include "GrAppliedClip.h"
 #include "GrBufferAllocPool.h"
 #include "GrDeferredUpload.h"
-#include "GrUninstantiateProxyTracker.h"
+#include "GrDeinstantiateProxyTracker.h"
 #include "SkArenaAlloc.h"
 #include "SkArenaAllocList.h"
 #include "ops/GrMeshDrawOp.h"
@@ -105,9 +105,7 @@
     // permissible).
     GrAtlasManager* atlasManager() const final;
 
-    GrUninstantiateProxyTracker* uninstantiateProxyTracker() {
-        return &fUninstantiateProxyTracker;
-    }
+    GrDeinstantiateProxyTracker* deinstantiateProxyTracker() { return &fDeinstantiateProxyTracker; }
 
 private:
     /** GrMeshDrawOp::Target override. */
@@ -164,8 +162,8 @@
     SkArenaAllocList<Draw>::Iter fCurrDraw;
     SkArenaAllocList<InlineUpload>::Iter fCurrUpload;
 
-    // Used to track the proxies that need to be uninstantiated after we finish a flush
-    GrUninstantiateProxyTracker fUninstantiateProxyTracker;
+    // Used to track the proxies that need to be deinstantiated after we finish a flush
+    GrDeinstantiateProxyTracker fDeinstantiateProxyTracker;
 };
 
 #endif
diff --git a/src/gpu/GrResourceAllocator.cpp b/src/gpu/GrResourceAllocator.cpp
index b495836..0f70894 100644
--- a/src/gpu/GrResourceAllocator.cpp
+++ b/src/gpu/GrResourceAllocator.cpp
@@ -7,6 +7,7 @@
 
 #include "GrResourceAllocator.h"
 
+#include "GrDeinstantiateProxyTracker.h"
 #include "GrGpuResourcePriv.h"
 #include "GrOpList.h"
 #include "GrRenderTargetProxy.h"
@@ -16,7 +17,6 @@
 #include "GrSurfaceProxy.h"
 #include "GrSurfaceProxyPriv.h"
 #include "GrTextureProxy.h"
-#include "GrUninstantiateProxyTracker.h"
 
 #if GR_TRACK_INTERVAL_CREATION
     #include <atomic>
@@ -109,8 +109,8 @@
         if (GrSurfaceProxy::LazyState::kNot != proxy->lazyInstantiationState()) {
             if (proxy->priv().doLazyInstantiation(fResourceProvider)) {
                 if (proxy->priv().lazyInstantiationType() ==
-                    GrSurfaceProxy::LazyInstantiationType::kUninstantiate) {
-                    fUninstantiateTracker->addProxy(proxy);
+                    GrSurfaceProxy::LazyInstantiationType::kDeinstantiate) {
+                    fDeinstantiateTracker->addProxy(proxy);
                 }
             }
         }
@@ -376,9 +376,9 @@
             if (!cur->proxy()->priv().doLazyInstantiation(fResourceProvider)) {
                 *outError = AssignError::kFailedProxyInstantiation;
             } else {
-                if (GrSurfaceProxy::LazyInstantiationType::kUninstantiate ==
+                if (GrSurfaceProxy::LazyInstantiationType::kDeinstantiate ==
                     cur->proxy()->priv().lazyInstantiationType()) {
-                    fUninstantiateTracker->addProxy(cur->proxy());
+                    fDeinstantiateTracker->addProxy(cur->proxy());
                 }
             }
         } else if (sk_sp<GrSurface> surface = this->findSurfaceFor(cur->proxy(), needsStencil)) {
diff --git a/src/gpu/GrResourceAllocator.h b/src/gpu/GrResourceAllocator.h
index c4d2343..ea1250f 100644
--- a/src/gpu/GrResourceAllocator.h
+++ b/src/gpu/GrResourceAllocator.h
@@ -16,8 +16,8 @@
 #include "SkTDynamicHash.h"
 #include "SkTMultiMap.h"
 
+class GrDeinstantiateProxyTracker;
 class GrResourceProvider;
-class GrUninstantiateProxyTracker;
 
 // Print out explicit allocation information
 #define GR_ALLOCATION_SPEW 0
@@ -42,8 +42,8 @@
  */
 class GrResourceAllocator {
 public:
-    GrResourceAllocator(GrResourceProvider* resourceProvider, GrUninstantiateProxyTracker* tracker)
-            : fResourceProvider(resourceProvider), fUninstantiateTracker(tracker) {}
+    GrResourceAllocator(GrResourceProvider* resourceProvider, GrDeinstantiateProxyTracker* tracker)
+            : fResourceProvider(resourceProvider), fDeinstantiateTracker(tracker) {}
 
     ~GrResourceAllocator();
 
@@ -212,7 +212,7 @@
     static const int kInitialArenaSize = 128 * sizeof(Interval);
 
     GrResourceProvider*          fResourceProvider;
-    GrUninstantiateProxyTracker* fUninstantiateTracker;
+    GrDeinstantiateProxyTracker* fDeinstantiateTracker;
     FreePoolMultiMap             fFreePool;          // Recently created/used GrSurfaces
     IntvlHash                    fIntvlHash;         // All the intervals, hashed by proxyID
 
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index ac650af..617f2aa 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -245,13 +245,12 @@
     return true;
 }
 
-void GrSurfaceProxy::deInstantiate() {
+void GrSurfaceProxy::deinstantiate() {
     SkASSERT(this->isInstantiated());
 
     this->release();
 }
 
-
 void GrSurfaceProxy::computeScratchKey(GrScratchKey* key) const {
     SkASSERT(LazyState::kFully != this->lazyInstantiationState());
     const GrRenderTargetProxy* rtp = this->asRenderTargetProxy();
diff --git a/src/gpu/GrSurfaceProxyPriv.h b/src/gpu/GrSurfaceProxyPriv.h
index ecddf58..a9076b8 100644
--- a/src/gpu/GrSurfaceProxyPriv.h
+++ b/src/gpu/GrSurfaceProxyPriv.h
@@ -60,10 +60,10 @@
         return fProxy->fLazyInstantiationType;
     }
 
-    bool isSafeToUninstantiate() const {
+    bool isSafeToDeinstantiate() const {
         return SkToBool(fProxy->fTarget) &&
                SkToBool(fProxy->fLazyInstantiateCallback) &&
-               GrSurfaceProxy::LazyInstantiationType::kUninstantiate == lazyInstantiationType();
+               GrSurfaceProxy::LazyInstantiationType::kDeinstantiate == lazyInstantiationType();
     }
 
     static bool SK_WARN_UNUSED_RESULT AttachStencilIfNeeded(GrResourceProvider*, GrSurface*,
diff --git a/src/gpu/GrUninstantiateProxyTracker.h b/src/gpu/GrUninstantiateProxyTracker.h
deleted file mode 100644
index 5245466..0000000
--- a/src/gpu/GrUninstantiateProxyTracker.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2018 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef GrUninstantiateProxyTracker_DEFINED
-#define GrUninstantiateProxyTracker_DEFINED
-
-#include "GrSurfaceProxy.h"
-#include "SkTArray.h"
-
-class GrUninstantiateProxyTracker {
-public:
-    GrUninstantiateProxyTracker() {}
-
-    // Adds a proxy which will be uninstantiated at the end of flush. The same proxy may not be
-    // added multiple times.
-    void addProxy(GrSurfaceProxy* proxy);
-
-    // Loops through all tracked proxies and uninstantiates them.
-    void uninstantiateAllProxies();
-
-private:
-    SkTArray<sk_sp<GrSurfaceProxy>> fProxies;
-};
-
-#endif
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 2404f36..b7ca814 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -385,7 +385,7 @@
             },
             backendFormat, desc, origin, mipMapped, GrInternalSurfaceFlags::kReadOnly,
             SkBackingFit::kExact, SkBudgeted::kNo,
-            GrSurfaceProxy::LazyInstantiationType::kUninstantiate);
+            GrSurfaceProxy::LazyInstantiationType::kDeinstantiate);
 
     if (!proxy) {
         return nullptr;
@@ -533,10 +533,9 @@
                 return sk_ref_sp<GrTexture>(tmp->getTexture());
 #endif
             },
-            yuvaFormats[yuvaIndices[SkYUVAIndex::kY_Index].fIndex],
-            desc, imageOrigin, GrMipMapped::kNo,
-            GrInternalSurfaceFlags::kReadOnly, SkBackingFit::kExact, SkBudgeted::kNo,
-            GrSurfaceProxy::LazyInstantiationType::kUninstantiate);
+            yuvaFormats[yuvaIndices[SkYUVAIndex::kY_Index].fIndex], desc, imageOrigin,
+            GrMipMapped::kNo, GrInternalSurfaceFlags::kReadOnly, SkBackingFit::kExact,
+            SkBudgeted::kNo, GrSurfaceProxy::LazyInstantiationType::kDeinstantiate);
 
     if (!proxy) {
         return nullptr;
diff --git a/src/image/SkImage_GpuYUVA.cpp b/src/image/SkImage_GpuYUVA.cpp
index 8932e8f..578f3ed 100644
--- a/src/image/SkImage_GpuYUVA.cpp
+++ b/src/image/SkImage_GpuYUVA.cpp
@@ -309,10 +309,9 @@
         desc.fConfig = params.fConfig;
         desc.fSampleCnt = 1;
         proxies[texIdx] = proxyProvider->createLazyProxy(
-                            std::move(lazyInstCallback), yuvaFormats[texIdx], desc, imageOrigin,
-                            GrMipMapped::kNo, GrInternalSurfaceFlags::kReadOnly,
-                            SkBackingFit::kExact, SkBudgeted::kNo,
-                            GrSurfaceProxy::LazyInstantiationType::kUninstantiate);
+                std::move(lazyInstCallback), yuvaFormats[texIdx], desc, imageOrigin,
+                GrMipMapped::kNo, GrInternalSurfaceFlags::kReadOnly, SkBackingFit::kExact,
+                SkBudgeted::kNo, GrSurfaceProxy::LazyInstantiationType::kDeinstantiate);
         if (!proxies[texIdx]) {
             return nullptr;
         }
diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp
index e3fea66..eb2520d 100644
--- a/tests/LazyProxyTest.cpp
+++ b/tests/LazyProxyTest.cpp
@@ -247,7 +247,7 @@
     for (bool doInstantiate : {true, false}) {
         for (auto lazyType : {LazyInstantiationType::kSingleUse,
                               LazyInstantiationType::kMultipleUse,
-                              LazyInstantiationType::kUninstantiate}) {
+                              LazyInstantiationType::kDeinstantiate}) {
             int testCount = 0;
             int* testCountPtr = &testCount;
             sk_sp<GrTextureProxy> proxy = proxyProvider->createLazyProxy(
@@ -390,14 +390,14 @@
     }
 }
 
-class LazyUninstantiateTestOp : public GrDrawOp {
+class LazyDeinstantiateTestOp : public GrDrawOp {
 public:
     DEFINE_OP_CLASS_ID
 
     static std::unique_ptr<GrDrawOp> Make(GrContext* context, sk_sp<GrTextureProxy> proxy) {
         GrOpMemoryPool* pool = context->contextPriv().opMemoryPool();
 
-        return pool->allocate<LazyUninstantiateTestOp>(std::move(proxy));
+        return pool->allocate<LazyDeinstantiateTestOp>(std::move(proxy));
     }
 
     void visitProxies(const VisitProxyFunc& func, VisitorType) const override {
@@ -407,13 +407,12 @@
 private:
     friend class GrOpMemoryPool; // for ctor
 
-    LazyUninstantiateTestOp(sk_sp<GrTextureProxy> proxy)
-            : INHERITED(ClassID())
-            , fLazyProxy(std::move(proxy)) {
+    LazyDeinstantiateTestOp(sk_sp<GrTextureProxy> proxy)
+            : INHERITED(ClassID()), fLazyProxy(std::move(proxy)) {
         this->setBounds(SkRect::MakeIWH(kSize, kSize), HasAABloat::kNo, IsZeroArea::kNo);
     }
 
-    const char* name() const override { return "LazyUninstantiateTestOp"; }
+    const char* name() const override { return "LazyDeinstantiateTestOp"; }
     FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; }
     RequiresDstTexture finalize(const GrCaps&, const GrAppliedClip*) override {
         return RequiresDstTexture::kNo;
@@ -426,13 +425,11 @@
     typedef GrDrawOp INHERITED;
 };
 
-static void UninstantiateReleaseProc(void* releaseValue) {
-    (*static_cast<int*>(releaseValue))++;
-}
+static void DeinstantiateReleaseProc(void* releaseValue) { (*static_cast<int*>(releaseValue))++; }
 
-// Test that lazy proxies with the Uninstantiate LazyCallbackType are uninstantiated and released as
+// Test that lazy proxies with the Deinstantiate LazyCallbackType are deinstantiated and released as
 // expected.
-DEF_GPUTEST(LazyProxyUninstantiateTest, reporter, /* options */) {
+DEF_GPUTEST(LazyProxyDeinstantiateTest, reporter, /* options */) {
     GrMockOptions mockOptions;
     sk_sp<GrContext> ctx = GrContext::MakeMock(&mockOptions, GrContextOptions());
     GrProxyProvider* proxyProvider = ctx->contextPriv().proxyProvider();
@@ -442,7 +439,7 @@
                 ctx->contextPriv().caps()->getBackendFormatFromColorType(kRGBA_8888_SkColorType);
 
     using LazyType = GrSurfaceProxy::LazyInstantiationType;
-    for (auto lazyType : {LazyType::kSingleUse, LazyType::kMultipleUse, LazyType::kUninstantiate}) {
+    for (auto lazyType : {LazyType::kSingleUse, LazyType::kMultipleUse, LazyType::kDeinstantiate}) {
         sk_sp<GrRenderTargetContext> rtc = ctx->contextPriv().makeDeferredRenderTargetContext(
                 format, SkBackingFit::kExact, 100, 100,
                 kRGBA_8888_GrPixelConfig, nullptr);
@@ -475,7 +472,7 @@
                         return sk_sp<GrTexture>();
                     }
                     (*instantiatePtr)++;
-                    texture->setRelease(UninstantiateReleaseProc, releasePtr);
+                    texture->setRelease(DeinstantiateReleaseProc, releasePtr);
                     return texture;
                 },
                 format, desc, kTopLeft_GrSurfaceOrigin, GrMipMapped::kNo,
@@ -483,12 +480,12 @@
 
         REPORTER_ASSERT(reporter, lazyProxy.get());
 
-        rtc->priv().testingOnly_addDrawOp(LazyUninstantiateTestOp::Make(ctx.get(), lazyProxy));
+        rtc->priv().testingOnly_addDrawOp(LazyDeinstantiateTestOp::Make(ctx.get(), lazyProxy));
 
         ctx->flush();
 
         REPORTER_ASSERT(reporter, 1 == instantiateTestValue);
-        if (LazyType::kUninstantiate == lazyType) {
+        if (LazyType::kDeinstantiate == lazyType) {
             REPORTER_ASSERT(reporter, 1 == releaseTestValue);
         } else {
             REPORTER_ASSERT(reporter, 0 == releaseTestValue);
@@ -496,12 +493,12 @@
 
         // This should cause the uninstantiate proxies to be instantiated again but have no effect
         // on the others
-        rtc->priv().testingOnly_addDrawOp(LazyUninstantiateTestOp::Make(ctx.get(), lazyProxy));
+        rtc->priv().testingOnly_addDrawOp(LazyDeinstantiateTestOp::Make(ctx.get(), lazyProxy));
         // Add a second op to make sure we only instantiate once.
-        rtc->priv().testingOnly_addDrawOp(LazyUninstantiateTestOp::Make(ctx.get(), lazyProxy));
+        rtc->priv().testingOnly_addDrawOp(LazyDeinstantiateTestOp::Make(ctx.get(), lazyProxy));
         ctx->flush();
 
-        if (LazyType::kUninstantiate == lazyType) {
+        if (LazyType::kDeinstantiate == lazyType) {
             REPORTER_ASSERT(reporter, 2 == instantiateTestValue);
             REPORTER_ASSERT(reporter, 2 == releaseTestValue);
         } else {
@@ -510,7 +507,7 @@
         }
 
         lazyProxy.reset();
-        if (LazyType::kUninstantiate == lazyType) {
+        if (LazyType::kDeinstantiate == lazyType) {
             REPORTER_ASSERT(reporter, 2 == releaseTestValue);
         } else {
             REPORTER_ASSERT(reporter, 1 == releaseTestValue);
diff --git a/tests/ResourceAllocatorTest.cpp b/tests/ResourceAllocatorTest.cpp
index 07d82b1..daf13c3 100644
--- a/tests/ResourceAllocatorTest.cpp
+++ b/tests/ResourceAllocatorTest.cpp
@@ -10,6 +10,7 @@
 #include "Test.h"
 
 #include "GrContextPriv.h"
+#include "GrDeinstantiateProxyTracker.h"
 #include "GrGpu.h"
 #include "GrProxyProvider.h"
 #include "GrResourceAllocator.h"
@@ -17,7 +18,6 @@
 #include "GrSurfaceProxyPriv.h"
 #include "GrTexture.h"
 #include "GrTextureProxy.h"
-#include "GrUninstantiateProxyTracker.h"
 
 #include "SkSurface.h"
 
@@ -90,8 +90,8 @@
 // assigned different GrSurfaces.
 static void overlap_test(skiatest::Reporter* reporter, GrResourceProvider* resourceProvider,
                          GrSurfaceProxy* p1, GrSurfaceProxy* p2, bool expectedResult) {
-    GrUninstantiateProxyTracker uninstantiateTracker;
-    GrResourceAllocator alloc(resourceProvider, &uninstantiateTracker);
+    GrDeinstantiateProxyTracker deinstantiateTracker;
+    GrResourceAllocator alloc(resourceProvider, &deinstantiateTracker);
 
     alloc.addInterval(p1, 0, 4);
     alloc.addInterval(p2, 1, 2);
@@ -113,8 +113,8 @@
 static void non_overlap_test(skiatest::Reporter* reporter, GrResourceProvider* resourceProvider,
                              GrSurfaceProxy* p1, GrSurfaceProxy* p2,
                              bool expectedResult) {
-    GrUninstantiateProxyTracker uninstantiateTracker;
-    GrResourceAllocator alloc(resourceProvider, &uninstantiateTracker);
+    GrDeinstantiateProxyTracker deinstantiateTracker;
+    GrResourceAllocator alloc(resourceProvider, &deinstantiateTracker);
 
     alloc.addInterval(p1, 0, 2);
     alloc.addInterval(p2, 3, 5);
@@ -311,7 +311,7 @@
         }
     };
     const GrBackendFormat format = caps->getBackendFormatFromColorType(p.fColorType);
-    auto lazyType = deinstantiate ? GrSurfaceProxy::LazyInstantiationType ::kUninstantiate
+    auto lazyType = deinstantiate ? GrSurfaceProxy::LazyInstantiationType ::kDeinstantiate
                                   : GrSurfaceProxy::LazyInstantiationType ::kSingleUse;
     GrInternalSurfaceFlags flags = GrInternalSurfaceFlags::kNone;
     if (p.fIsRT && caps->maxWindowRectangles() > 0) {
@@ -343,9 +343,9 @@
         auto p2 = make_lazy(proxyProvider, caps, rtParams, true);
         auto p3 = make_lazy(proxyProvider, caps, rtParams, false);
 
-        GrUninstantiateProxyTracker uninstantiateTracker;
+        GrDeinstantiateProxyTracker deinstantiateTracker;
         {
-            GrResourceAllocator alloc(resourceProvider, &uninstantiateTracker);
+            GrResourceAllocator alloc(resourceProvider, &deinstantiateTracker);
             alloc.addInterval(p0.get(), 0, 1);
             alloc.addInterval(p1.get(), 0, 1);
             alloc.addInterval(p2.get(), 0, 1);
@@ -355,7 +355,7 @@
             GrResourceAllocator::AssignError error;
             alloc.assign(&startIndex, &stopIndex, &error);
         }
-        uninstantiateTracker.uninstantiateAllProxies();
+        deinstantiateTracker.deinstantiateAllProxies();
         REPORTER_ASSERT(reporter, !p0->isInstantiated());
         REPORTER_ASSERT(reporter, p1->isInstantiated());
         REPORTER_ASSERT(reporter, !p2->isInstantiated());