Make some GrSurfaceProxy and GrTextureProxy methods easier to access

Move peek[Surface|Texture|RenderTarget]() from GrSurfaceProxyPriv to
to GrSurfaceProxy.

Move proxyMipMapped(), textureType(), and hasRestrictedSampling()
from GrTextureProxyPriv to GrTextureProxy.

Change-Id: I259114d0508c4613d55f7f1faccac362fa6fb281
Reviewed-on: https://skia-review.googlesource.com/144641
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index 327ceb1..425b183 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -333,6 +333,21 @@
     virtual GrRenderTargetProxy* asRenderTargetProxy() { return nullptr; }
     virtual const GrRenderTargetProxy* asRenderTargetProxy() const { return nullptr; }
 
+    bool isInstantiated() const { return SkToBool(fTarget); }
+
+    // If the proxy is already instantiated, return its backing GrTexture; if not, return null.
+    GrSurface* peekSurface() const { return fTarget; }
+
+    // If this is a texture proxy and the proxy is already instantiated, return its backing
+    // GrTexture; if not, return null.
+    GrTexture* peekTexture() const { return fTarget ? fTarget->asTexture() : nullptr; }
+
+    // If this is a render target proxy and the proxy is already instantiated, return its backing
+    // GrRenderTarget; if not, return null.
+    GrRenderTarget* peekRenderTarget() const {
+        return fTarget ? fTarget->asRenderTarget() : nullptr;
+    }
+
     /**
      * Does the resource count against the resource budget?
      */
diff --git a/include/private/GrTextureProxy.h b/include/private/GrTextureProxy.h
index 3846954..4df0263 100644
--- a/include/private/GrTextureProxy.h
+++ b/include/private/GrTextureProxy.h
@@ -36,6 +36,13 @@
     // generation later.
     GrMipMapped mipMapped() const;
 
+    // Returns the GrMipMapped value of the proxy from creation time regardless of whether it has
+    // been instantiated or not.
+    GrMipMapped proxyMipMapped() const { return fMipMapped; }
+
+    GrTextureType textureType() const { return fTextureType; }
+    /** If true then the texture does not support MIP maps and only supports clamp wrap mode. */
+    bool hasRestrictedSampling() const { return GrTextureTypeHasRestrictedSampling(fTextureType); }
     /**
      * Return the texture proxy's unique key. It will be invalid if the proxy doesn't have one.
      */
diff --git a/src/core/SkDeferredDisplayListRecorder.cpp b/src/core/SkDeferredDisplayListRecorder.cpp
index b698984..67f847c 100644
--- a/src/core/SkDeferredDisplayListRecorder.cpp
+++ b/src/core/SkDeferredDisplayListRecorder.cpp
@@ -128,8 +128,8 @@
 
                 // The proxy backing the destination surface had better have been instantiated
                 // prior to the proxy backing the DLL's surface. Steal its GrRenderTarget.
-                SkASSERT(lazyProxyData->fReplayDest->priv().peekSurface());
-                return sk_ref_sp<GrSurface>(lazyProxyData->fReplayDest->priv().peekSurface());
+                SkASSERT(lazyProxyData->fReplayDest->peekSurface());
+                return sk_ref_sp<GrSurface>(lazyProxyData->fReplayDest->peekSurface());
             },
             desc,
             fCharacterization.origin(),
diff --git a/src/effects/imagefilters/SkDisplacementMapEffect.cpp b/src/effects/imagefilters/SkDisplacementMapEffect.cpp
index 356e82e..64db1cd 100644
--- a/src/effects/imagefilters/SkDisplacementMapEffect.cpp
+++ b/src/effects/imagefilters/SkDisplacementMapEffect.cpp
@@ -608,7 +608,7 @@
                                           const GrFragmentProcessor& proc) {
     const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMapEffect>();
     GrSurfaceProxy* proxy = displacementMap.textureSampler(1).proxy();
-    GrTexture* colorTex = proxy->priv().peekTexture();
+    GrTexture* colorTex = proxy->peekTexture();
 
     SkScalar scaleX = displacementMap.scale().fX / colorTex->width();
     SkScalar scaleY = displacementMap.scale().fY / colorTex->height();
diff --git a/src/effects/imagefilters/SkLightingImageFilter.cpp b/src/effects/imagefilters/SkLightingImageFilter.cpp
index 486a3ef..dc7cd74 100644
--- a/src/effects/imagefilters/SkLightingImageFilter.cpp
+++ b/src/effects/imagefilters/SkLightingImageFilter.cpp
@@ -1917,7 +1917,7 @@
     }
 
     GrTextureProxy* proxy = lighting.textureSampler(0).proxy();
-    GrTexture* texture = proxy->priv().peekTexture();
+    GrTexture* texture = proxy->peekTexture();
 
     float ySign = proxy->origin() == kTopLeft_GrSurfaceOrigin ? -1.0f : 1.0f;
     pdman.set2f(fImageIncrementUni, 1.0f / texture->width(), ySign / texture->height());
diff --git a/src/effects/imagefilters/SkMorphologyImageFilter.cpp b/src/effects/imagefilters/SkMorphologyImageFilter.cpp
index 99060b9..24686f8 100644
--- a/src/effects/imagefilters/SkMorphologyImageFilter.cpp
+++ b/src/effects/imagefilters/SkMorphologyImageFilter.cpp
@@ -278,7 +278,7 @@
                                      const GrFragmentProcessor& proc) {
     const GrMorphologyEffect& m = proc.cast<GrMorphologyEffect>();
     GrSurfaceProxy* proxy = m.textureSampler(0).proxy();
-    GrTexture& texture = *proxy->priv().peekTexture();
+    GrTexture& texture = *proxy->peekTexture();
 
     float pixelSize = 0.0f;
     switch (m.direction()) {
diff --git a/src/gpu/GrAHardwareBufferImageGenerator.cpp b/src/gpu/GrAHardwareBufferImageGenerator.cpp
index b00661f..a457df6 100644
--- a/src/gpu/GrAHardwareBufferImageGenerator.cpp
+++ b/src/gpu/GrAHardwareBufferImageGenerator.cpp
@@ -135,7 +135,7 @@
 
         // We need to get the actual GrTexture so force instantiation of the GrTextureProxy
         texProxy->instantiate(context->contextPriv().resourceProvider());
-        GrTexture* texture = texProxy->priv().peekTexture();
+        GrTexture* texture = texProxy->peekTexture();
         SkASSERT(texture);
         fOriginalTexture = texture;
     }
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 8380f0d..8b97a93 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -42,9 +42,9 @@
 #include <unordered_map>
 
 #define ASSERT_OWNED_PROXY(P) \
-SkASSERT(!(P) || !((P)->priv().peekTexture()) || (P)->priv().peekTexture()->getContext() == this)
+    SkASSERT(!(P) || !((P)->peekTexture()) || (P)->peekTexture()->getContext() == this)
 #define ASSERT_OWNED_PROXY_PRIV(P) \
-SkASSERT(!(P) || !((P)->priv().peekTexture()) || (P)->priv().peekTexture()->getContext() == fContext)
+    SkASSERT(!(P) || !((P)->peekTexture()) || (P)->peekTexture()->getContext() == fContext)
 
 #define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == this)
 #define ASSERT_SINGLE_OWNER \
@@ -469,7 +469,7 @@
     }
 
     GrSurfaceProxy* dstProxy = dst->asSurfaceProxy();
-    GrSurface* dstSurface = dstProxy->priv().peekSurface();
+    GrSurface* dstSurface = dstProxy->peekSurface();
 
     if (!GrSurfacePriv::AdjustWritePixelParams(dstSurface->width(), dstSurface->height(),
                                                GrColorTypeBytesPerPixel(srcColorType), &left, &top,
@@ -640,7 +640,7 @@
     }
 
     GrSurfaceProxy* srcProxy = src->asSurfaceProxy();
-    GrSurface* srcSurface = srcProxy->priv().peekSurface();
+    GrSurface* srcSurface = srcProxy->peekSurface();
 
     if (!GrSurfacePriv::AdjustReadPixelParams(srcSurface->width(), srcSurface->height(),
                                               GrColorTypeBytesPerPixel(dstColorType), &left, &top,
diff --git a/src/gpu/GrCoordTransform.h b/src/gpu/GrCoordTransform.h
index 5d3faa3..f01d832 100644
--- a/src/gpu/GrCoordTransform.h
+++ b/src/gpu/GrCoordTransform.h
@@ -116,10 +116,7 @@
 
     // This should only ever be called at flush time after the backing texture has been
     // successfully instantiated
-    GrTexture* peekTexture() const {
-        SkASSERT(fProxy->priv().peekTexture());
-        return fProxy->priv().peekTexture();
-    }
+    GrTexture* peekTexture() const { return fProxy->peekTexture(); }
 
 private:
     // The textures' effect is to optionally normalize the final matrix, so a blind
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index 429ad6a..d891c02 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -29,7 +29,7 @@
 void GrDrawOpAtlas::instantiate(GrOnFlushResourceProvider* onFlushResourceProvider) {
     for (uint32_t i = 0; i < fNumActivePages; ++i) {
         // All the atlas pages are now instantiated at flush time in the activeNewPage method.
-        SkASSERT(fProxies[i] && fProxies[i]->priv().isInstantiated());
+        SkASSERT(fProxies[i] && fProxies[i]->isInstantiated());
     }
 }
 
@@ -136,7 +136,7 @@
 void GrDrawOpAtlas::Plot::uploadToTexture(GrDeferredTextureUploadWritePixelsFn& writePixels,
                                           GrTextureProxy* proxy) {
     // We should only be issuing uploads if we are in fact dirty
-    SkASSERT(fDirty && fData && proxy && proxy->priv().peekTexture());
+    SkASSERT(fDirty && fData && proxy && proxy->peekTexture());
     TRACE_EVENT0("skia.gpu", TRACE_FUNC);
     size_t rowBytes = fBytesPerPixel * fWidth;
     const unsigned char* dataPtr = fData;
@@ -218,7 +218,7 @@
         sk_sp<Plot> plotsp(SkRef(plot));
 
         GrTextureProxy* proxy = fProxies[pageIdx].get();
-        SkASSERT(proxy->priv().isInstantiated());  // This is occurring at flush time
+        SkASSERT(proxy->isInstantiated());  // This is occurring at flush time
 
         GrDeferredUploadToken lastUploadToken = target->addASAPUpload(
                 [plotsp, proxy](GrDeferredTextureUploadWritePixelsFn& writePixels) {
@@ -232,7 +232,7 @@
 
 bool GrDrawOpAtlas::uploadToPage(unsigned int pageIdx, AtlasID* id, GrDeferredUploadTarget* target,
                                  int width, int height, const void* image, SkIPoint16* loc) {
-    SkASSERT(fProxies[pageIdx] && fProxies[pageIdx]->priv().isInstantiated());
+    SkASSERT(fProxies[pageIdx] && fProxies[pageIdx]->isInstantiated());
 
     // look through all allocated plots for one we can share, in Most Recently Refed order
     PlotList::Iter plotIter;
@@ -351,7 +351,7 @@
     sk_sp<Plot> plotsp(SkRef(newPlot.get()));
 
     GrTextureProxy* proxy = fProxies[pageIdx].get();
-    SkASSERT(proxy->priv().isInstantiated());
+    SkASSERT(proxy->isInstantiated());
 
     GrDeferredUploadToken lastUploadToken = target->addInlineUpload(
             [plotsp, proxy](GrDeferredTextureUploadWritePixelsFn& writePixels) {
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 39ff76f..d7c5129 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -376,7 +376,7 @@
         return result;
     }
 
-    GrSurface* surface = proxy->priv().peekSurface();
+    GrSurface* surface = proxy->peekSurface();
     if (auto* rt = surface->asRenderTarget()) {
         gpu->resolveRenderTarget(rt);
     }
diff --git a/src/gpu/GrFragmentProcessor.h b/src/gpu/GrFragmentProcessor.h
index 8a35c57..9075015 100644
--- a/src/gpu/GrFragmentProcessor.h
+++ b/src/gpu/GrFragmentProcessor.h
@@ -437,8 +437,8 @@
 
     // 'peekTexture' should only ever be called after a successful 'instantiate' call
     GrTexture* peekTexture() const {
-        SkASSERT(fProxyRef.get()->priv().peekTexture());
-        return fProxyRef.get()->priv().peekTexture();
+        SkASSERT(fProxyRef.get()->peekTexture());
+        return fProxyRef.get()->peekTexture();
     }
 
     GrTextureProxy* proxy() const { return fProxyRef.get()->asTextureProxy(); }
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 62eef09..ca07496 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -74,7 +74,7 @@
     if (texProxy) {
         // If the texture format itself doesn't support repeat wrap mode or mipmapping (and
         // those capabilities are required) force a copy.
-        if (texProxy->texPriv().hasRestrictedSampling()) {
+        if (texProxy->hasRestrictedSampling()) {
             copyParams->fFilter = GrSamplerState::Filter::kNearest;
             copyParams->fWidth = texProxy->width();
             copyParams->fHeight = texProxy->height();
diff --git a/src/gpu/GrOpFlushState.cpp b/src/gpu/GrOpFlushState.cpp
index d0a8538..8d8b7bb 100644
--- a/src/gpu/GrOpFlushState.cpp
+++ b/src/gpu/GrOpFlushState.cpp
@@ -83,7 +83,7 @@
                                                      int width, int height,
                                                      GrColorType srcColorType, const void* buffer,
                                                      size_t rowBytes) {
-        GrSurface* dstSurface = dstProxy->priv().peekSurface();
+        GrSurface* dstSurface = dstProxy->peekSurface();
         if (!fGpu->caps()->surfaceSupportsWritePixels(dstSurface) &&
             fGpu->caps()->supportedWritePixelsColorType(dstSurface->config(), srcColorType) != srcColorType) {
             return false;
diff --git a/src/gpu/GrOpFlushState.h b/src/gpu/GrOpFlushState.h
index 28e0f68..66ac34c 100644
--- a/src/gpu/GrOpFlushState.h
+++ b/src/gpu/GrOpFlushState.h
@@ -49,7 +49,7 @@
 
     /** Additional data required on a per-op basis when executing GrOps. */
     struct OpArgs {
-        GrRenderTarget* renderTarget() const { return fProxy->priv().peekRenderTarget(); }
+        GrRenderTarget* renderTarget() const { return fProxy->peekRenderTarget(); }
 
         GrOp* fOp;
         // TODO: do we still need the dst proxy here?
diff --git a/src/gpu/GrOpList.cpp b/src/gpu/GrOpList.cpp
index c9b61be..9f2ee4a 100644
--- a/src/gpu/GrOpList.cpp
+++ b/src/gpu/GrOpList.cpp
@@ -73,7 +73,7 @@
 void GrOpList::instantiateDeferredProxies(GrResourceProvider* resourceProvider) {
     for (int i = 0; i < fDeferredProxies.count(); ++i) {
         if (resourceProvider->explicitlyAllocateGPUResources()) {
-            SkASSERT(fDeferredProxies[i]->priv().isInstantiated());
+            SkASSERT(fDeferredProxies[i]->isInstantiated());
         } else {
             fDeferredProxies[i]->instantiate(resourceProvider);
         }
@@ -135,9 +135,7 @@
     return false;
 }
 
-bool GrOpList::isInstantiated() const {
-    return fTarget.get()->priv().isInstantiated();
-}
+bool GrOpList::isInstantiated() const { return fTarget.get()->isInstantiated(); }
 
 bool GrOpList::isFullyInstantiated() const {
     if (!this->isInstantiated()) {
@@ -150,7 +148,7 @@
                                         : false;
 
     if (needsStencil) {
-        GrRenderTarget* rt = proxy->priv().peekRenderTarget();
+        GrRenderTarget* rt = proxy->peekRenderTarget();
 
         if (!rt->renderTargetPriv().getStencilAttachment()) {
             return false;
@@ -169,8 +167,9 @@
     SkDebugf("--------------------------------------------------------------\n");
     SkDebugf("opListID: %d - proxyID: %d - surfaceID: %d\n", fUniqueID,
              fTarget.get() ? fTarget.get()->uniqueID().asUInt() : -1,
-             fTarget.get() && fTarget.get()->priv().peekSurface()
-                                ? fTarget.get()->priv().peekSurface()->uniqueID().asUInt() : -1);
+             fTarget.get() && fTarget.get()->peekSurface()
+                     ? fTarget.get()->peekSurface()->uniqueID().asUInt()
+                     : -1);
     SkDebugf("ColorLoadOp: %s %x StencilLoadOp: %s\n",
              op_to_name(fColorLoadOp),
              GrLoadOp::kClear == fColorLoadOp ? fLoadClearColor : 0x0,
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index 5054564..5b59f95 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -93,7 +93,7 @@
 
 GrXferBarrierType GrPipeline::xferBarrierType(const GrCaps& caps) const {
     if (fDstTextureProxy.get() &&
-        fDstTextureProxy.get()->priv().peekTexture() == fProxy.get()->priv().peekTexture()) {
+        fDstTextureProxy.get()->peekTexture() == fProxy.get()->peekTexture()) {
         return kTexture_GrXferBarrierType;
     }
     return this->getXferProcessor().xferBarrierType(caps);
diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h
index cb741ae..24dd9f8 100644
--- a/src/gpu/GrPipeline.h
+++ b/src/gpu/GrPipeline.h
@@ -137,7 +137,7 @@
 
     GrTexture* peekDstTexture(SkIPoint* offset = nullptr) const {
         if (GrTextureProxy* dstProxy = this->dstTextureProxy(offset)) {
-            return dstProxy->priv().peekTexture();
+            return dstProxy->peekTexture();
         }
 
         return nullptr;
@@ -165,7 +165,7 @@
      * @return    The currently set render target.
      */
     GrRenderTargetProxy* proxy() const { return fProxy.get(); }
-    GrRenderTarget* renderTarget() const { return fProxy.get()->priv().peekRenderTarget(); }
+    GrRenderTarget* renderTarget() const { return fProxy.get()->peekRenderTarget(); }
 
     const GrUserStencilSettings* getUserStencil() const { return fUserStencilSettings; }
 
diff --git a/src/gpu/GrPrimitiveProcessor.h b/src/gpu/GrPrimitiveProcessor.h
index d5d5d5f..20471ea 100644
--- a/src/gpu/GrPrimitiveProcessor.h
+++ b/src/gpu/GrPrimitiveProcessor.h
@@ -212,8 +212,8 @@
 
     // 'peekTexture' should only ever be called after a successful 'instantiate' call
     GrTexture* peekTexture() const {
-        SkASSERT(fProxyRef.get()->priv().peekTexture());
-        return fProxyRef.get()->priv().peekTexture();
+        SkASSERT(fProxyRef.get()->peekTexture());
+        return fProxyRef.get()->peekTexture();
     }
 
     GrTextureProxy* proxy() const { return fProxyRef.get()->asTextureProxy(); }
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index 67643d7..c359601 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -86,8 +86,7 @@
     // same resource (rather than re-wrapping). When a wrapped resource is no longer referenced,
     // it will always be released - it is never converted to a scratch resource.
     if (SkBudgeted::kNo == proxy->isBudgeted() &&
-                    (!proxy->priv().isInstantiated() ||
-                     !proxy->priv().peekSurface()->resourcePriv().refsWrappedObjects())) {
+        (!proxy->isInstantiated() || !proxy->peekSurface()->resourcePriv().refsWrappedObjects())) {
         return false;
     }
 
@@ -667,7 +666,7 @@
 }
 
 bool GrProxyProvider::IsFunctionallyExact(GrSurfaceProxy* proxy) {
-    const bool isInstantiated = proxy->priv().isInstantiated();
+    const bool isInstantiated = proxy->isInstantiated();
     // A proxy is functionally exact if:
     //   it is exact (obvs)
     //   when it is instantiated it will be exact (i.e., power of two dimensions)
@@ -696,8 +695,8 @@
     fUniquelyKeyedProxies.remove(key);
     proxy->cacheAccess().clearUniqueKey();
 
-    if (invalidateSurface && proxy->priv().isInstantiated()) {
-        GrSurface* surface = proxy->priv().peekSurface();
+    if (invalidateSurface && proxy->isInstantiated()) {
+        GrSurface* surface = proxy->peekSurface();
         if (surface) {
             surface->resourcePriv().removeUniqueKey();
         }
diff --git a/src/gpu/GrRenderTargetContext.h b/src/gpu/GrRenderTargetContext.h
index 4e31a1a..602ecc3 100644
--- a/src/gpu/GrRenderTargetContext.h
+++ b/src/gpu/GrRenderTargetContext.h
@@ -354,7 +354,7 @@
         if (!fRenderTargetProxy->instantiate(fContext->contextPriv().resourceProvider())) {
             return nullptr;
         }
-        return fRenderTargetProxy->priv().peekRenderTarget();
+        return fRenderTargetProxy->peekRenderTarget();
     }
 
     GrSurfaceProxy* asSurfaceProxy() override { return fRenderTargetProxy.get(); }
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 530f1ae..569b5fa 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -81,7 +81,7 @@
 #endif
 
 void GrRenderTargetOpList::onPrepare(GrOpFlushState* flushState) {
-    SkASSERT(fTarget.get()->priv().peekRenderTarget());
+    SkASSERT(fTarget.get()->peekRenderTarget());
     SkASSERT(this->isClosed());
 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
     TRACE_EVENT0("skia", TRACE_FUNC);
@@ -160,16 +160,17 @@
         return false;
     }
 
-    SkASSERT(fTarget.get()->priv().peekRenderTarget());
+    SkASSERT(fTarget.get()->peekRenderTarget());
     TRACE_EVENT0("skia", TRACE_FUNC);
 
     // TODO: at the very least, we want the stencil store op to always be discard (at this
     // level). In Vulkan, sub-command buffers would still need to load & store the stencil buffer.
     std::unique_ptr<GrGpuRTCommandBuffer> commandBuffer = create_command_buffer(
                                                     flushState->gpu(),
-                                                    fTarget.get()->priv().peekRenderTarget(),
+                                                    fTarget.get()->peekRenderTarget(),
                                                     fTarget.get()->origin(),
-                                                    fColorLoadOp, fLoadClearColor,
+                                                    fColorLoadOp,
+                                                    fLoadClearColor,
                                                     fStencilLoadOp);
     flushState->setCommandBuffer(commandBuffer.get());
     commandBuffer->begin();
@@ -262,8 +263,8 @@
 
 void GrRenderTargetOpList::purgeOpsWithUninstantiatedProxies() {
     bool hasUninstantiatedProxy = false;
-    auto checkInstantiation = [ &hasUninstantiatedProxy ] (GrSurfaceProxy* p) {
-        if (!p->priv().isInstantiated()) {
+    auto checkInstantiation = [&hasUninstantiatedProxy](GrSurfaceProxy* p) {
+        if (!p->isInstantiated()) {
             hasUninstantiatedProxy = true;
         }
     };
@@ -283,7 +284,7 @@
     unsigned int cur = alloc->numOps();
 
     for (int i = 0; i < fDeferredProxies.count(); ++i) {
-        SkASSERT(!fDeferredProxies[i]->priv().isInstantiated());
+        SkASSERT(!fDeferredProxies[i]->isInstantiated());
         // We give all the deferred proxies a write usage at the very start of flushing. This
         // locks them out of being reused for the entire flush until they are read - and then
         // they can be recycled. This is a bit unfortunate because a flush can proceed in waves
diff --git a/src/gpu/GrResourceAllocator.cpp b/src/gpu/GrResourceAllocator.cpp
index 8cc695f..4c91c2f 100644
--- a/src/gpu/GrResourceAllocator.cpp
+++ b/src/gpu/GrResourceAllocator.cpp
@@ -261,10 +261,9 @@
                                             ? cur->proxy()->asRenderTargetProxy()->needsStencil()
                                             : false;
 
-        if (cur->proxy()->priv().isInstantiated()) {
-            if (!GrSurfaceProxyPriv::AttachStencilIfNeeded(fResourceProvider,
-                                                           cur->proxy()->priv().peekSurface(),
-                                                           needsStencil)) {
+        if (cur->proxy()->isInstantiated()) {
+            if (!GrSurfaceProxyPriv::AttachStencilIfNeeded(
+                        fResourceProvider, cur->proxy()->peekSurface(), needsStencil)) {
                 *outError = AssignError::kFailedProxyInstantiation;
             }
 
@@ -307,7 +306,7 @@
 
             cur->assign(std::move(surface));
         } else {
-            SkASSERT(!cur->proxy()->priv().isInstantiated());
+            SkASSERT(!cur->proxy()->isInstantiated());
             *outError = AssignError::kFailedProxyInstantiation;
         }
 
@@ -337,8 +336,7 @@
     for(const Interval* cur = fIntvlList.peekHead(); cur; cur = cur->next()) {
         SkDebugf("{ %3d,%3d }: [%2d, %2d] - proxyRefs:%d surfaceRefs:%d R:%d W:%d\n",
                  cur->proxy()->uniqueID().asUInt(),
-                 cur->proxy()->priv().isInstantiated() ? cur->proxy()->underlyingUniqueID().asUInt()
-                                                       : -1,
+                 cur->proxy()->isInstantiated() ? cur->proxy()->underlyingUniqueID().asUInt() : -1,
                  cur->start(),
                  cur->end(),
                  cur->proxy()->priv().getProxyRefCnt(),
@@ -353,8 +351,7 @@
     for(const Interval* cur = fIntvlList.peekHead(); cur; cur = cur->next()) {
         SkDebugf("{ %3d,%3d }: ",
                  cur->proxy()->uniqueID().asUInt(),
-                 cur->proxy()->priv().isInstantiated() ? cur->proxy()->underlyingUniqueID().asUInt()
-                                                       : -1);
+                 cur->proxy()->isInstantiated() ? cur->proxy()->underlyingUniqueID().asUInt() : -1);
         for (unsigned int i = min; i <= max; ++i) {
             if (i >= cur->start() && i <= cur->end()) {
                 SkDebugf("x");
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 3450b00..11843b3 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -127,7 +127,7 @@
             return nullptr;
         }
         SkAssertResult(sContext->writePixels(srcInfo, mipLevel.fPixels, mipLevel.fRowBytes, 0, 0));
-        return sk_ref_sp(sContext->asTextureProxy()->priv().peekTexture());
+        return sk_ref_sp(sContext->asTextureProxy()->peekTexture());
     } else {
         return fGpu->createTexture(desc, budgeted, &mipLevel, 1);
     }
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index 14f535e..0e0004b 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -231,7 +231,7 @@
 }
 
 void GrSurfaceProxy::deInstantiate() {
-    SkASSERT(this->priv().isInstantiated());
+    SkASSERT(this->isInstantiated());
 
     this->release();
 }
diff --git a/src/gpu/GrSurfaceProxyPriv.h b/src/gpu/GrSurfaceProxyPriv.h
index 47e99b7..ecddf58 100644
--- a/src/gpu/GrSurfaceProxyPriv.h
+++ b/src/gpu/GrSurfaceProxyPriv.h
@@ -17,26 +17,6 @@
     data members or virtual methods. */
 class GrSurfaceProxyPriv {
 public:
-    bool isInstantiated() const { return SkToBool(fProxy->fTarget); }
-
-    // This should only be called after a successful call to instantiate
-    GrSurface* peekSurface() const {
-        SkASSERT(fProxy->fTarget);
-        return fProxy->fTarget;
-    }
-
-    // If the proxy is already instantiated, return its backing GrTexture; if not,
-    // return null
-    GrTexture* peekTexture() const {
-        return fProxy->fTarget ? fProxy->fTarget->asTexture() : nullptr;
-    }
-
-    // This should only be called after a successful call to instantiate
-    GrRenderTarget* peekRenderTarget() const {
-        SkASSERT(fProxy->fTarget && fProxy->fTarget->asRenderTarget());
-        return fProxy->fTarget ? fProxy->fTarget->asRenderTarget() : nullptr;
-    }
-
     // Beware! Woe betide anyone whosoever calls this method.
     // The refs on proxies and their backing GrSurfaces shift around based on whether the proxy
     // is instantiated or not. Additionally, the lifetime of a proxy (and a GrSurface) also
diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp
index 6af9588..f63bad1 100644
--- a/src/gpu/GrTextureOpList.cpp
+++ b/src/gpu/GrTextureOpList.cpp
@@ -72,7 +72,7 @@
 #endif
 
 void GrTextureOpList::onPrepare(GrOpFlushState* flushState) {
-    SkASSERT(fTarget.get()->priv().peekTexture());
+    SkASSERT(fTarget.get()->peekTexture());
     SkASSERT(this->isClosed());
 
     // Loop over the ops that haven't yet generated their geometry
@@ -96,10 +96,10 @@
         return false;
     }
 
-    SkASSERT(fTarget.get()->priv().peekTexture());
+    SkASSERT(fTarget.get()->peekTexture());
 
     std::unique_ptr<GrGpuTextureCommandBuffer> commandBuffer(
-                         flushState->gpu()->createCommandBuffer(fTarget.get()->priv().peekTexture(),
+                         flushState->gpu()->createCommandBuffer(fTarget.get()->peekTexture(),
                                                                 fTarget.get()->origin()));
     flushState->setCommandBuffer(commandBuffer.get());
 
@@ -158,8 +158,8 @@
 
 void GrTextureOpList::purgeOpsWithUninstantiatedProxies() {
     bool hasUninstantiatedProxy = false;
-    auto checkInstantiation = [ &hasUninstantiatedProxy ] (GrSurfaceProxy* p) {
-        if (!p->priv().isInstantiated()) {
+    auto checkInstantiation = [&hasUninstantiatedProxy](GrSurfaceProxy* p) {
+        if (!p->isInstantiated()) {
             hasUninstantiatedProxy = true;
         }
     };
diff --git a/src/gpu/GrTextureProxy.cpp b/src/gpu/GrTextureProxy.cpp
index fc6a2fa..2cd020e 100644
--- a/src/gpu/GrTextureProxy.cpp
+++ b/src/gpu/GrTextureProxy.cpp
@@ -132,15 +132,15 @@
 }
 
 GrMipMapped GrTextureProxy::mipMapped() const {
-    if (this->priv().isInstantiated()) {
-        return this->priv().peekTexture()->texturePriv().mipMapped();
+    if (this->isInstantiated()) {
+        return this->peekTexture()->texturePriv().mipMapped();
     }
     return fMipMapped;
 }
 
 size_t GrTextureProxy::onUninstantiatedGpuMemorySize() const {
     return GrSurface::ComputeSize(this->config(), this->width(), this->height(), 1,
-                                  this->texPriv().proxyMipMapped(), !this->priv().isExact());
+                                  this->proxyMipMapped(), !this->priv().isExact());
 }
 
 void GrTextureProxy::setUniqueKey(GrProxyProvider* proxyProvider, const GrUniqueKey& key) {
@@ -169,7 +169,7 @@
 
     // Anything that is checked here should be duplicated in GrTextureRenderTargetProxy's version
     SkASSERT(surface->asTexture());
-    SkASSERT(GrMipMapped::kNo == this->texPriv().proxyMipMapped() ||
+    SkASSERT(GrMipMapped::kNo == this->proxyMipMapped() ||
              GrMipMapped::kYes == surface->asTexture()->texturePriv().mipMapped());
     SkASSERT(surface->asTexture()->texturePriv().textureType() == fTextureType);
 }
diff --git a/src/gpu/GrTextureProxyPriv.h b/src/gpu/GrTextureProxyPriv.h
index 519e96b..e961493 100644
--- a/src/gpu/GrTextureProxyPriv.h
+++ b/src/gpu/GrTextureProxyPriv.h
@@ -27,14 +27,6 @@
     // Clears any deferred uploader object on the proxy. Used to free the CPU data after the
     // contents have been uploaded.
     void resetDeferredUploader();
-    // Returns the GrMipMapped value of the proxy from creation time regardless of whether it has
-    // been instantiated or not.
-    GrMipMapped proxyMipMapped() const { return fTextureProxy->fMipMapped; }
-
-    GrTextureType textureType() const { return fTextureProxy->fTextureType; }
-    bool hasRestrictedSampling() const {
-        return GrTextureTypeHasRestrictedSampling(this->textureType());
-    }
 
 private:
     explicit GrTextureProxyPriv(GrTextureProxy* textureProxy) : fTextureProxy(textureProxy) {}
diff --git a/src/gpu/GrTextureRenderTargetProxy.cpp b/src/gpu/GrTextureRenderTargetProxy.cpp
index 5b87399..f0abf11 100644
--- a/src/gpu/GrTextureRenderTargetProxy.cpp
+++ b/src/gpu/GrTextureRenderTargetProxy.cpp
@@ -70,7 +70,7 @@
 
     // TODO: do we have enough information to improve this worst case estimate?
     return GrSurface::ComputeSize(this->config(), this->width(), this->height(),
-                                  colorSamplesPerPixel, this->texPriv().proxyMipMapped(),
+                                  colorSamplesPerPixel, this->proxyMipMapped(),
                                   !this->priv().isExact());
 }
 
@@ -116,7 +116,7 @@
 void GrTextureRenderTargetProxy::onValidateSurface(const GrSurface* surface) {
     // Anything checked here should also be checking the GrTextureProxy version
     SkASSERT(surface->asTexture());
-    SkASSERT(GrMipMapped::kNo == this->texPriv().proxyMipMapped() ||
+    SkASSERT(GrMipMapped::kNo == this->proxyMipMapped() ||
              GrMipMapped::kYes == surface->asTexture()->texturePriv().mipMapped());
 
     // Anything checked here should also be checking the GrRenderTargetProxy version
@@ -127,7 +127,7 @@
     GrInternalSurfaceFlags surfaceFlags = surface->surfacePriv().flags();
     SkASSERT((proxyFlags & GrInternalSurfaceFlags::kRenderTargetMask) ==
              (surfaceFlags & GrInternalSurfaceFlags::kRenderTargetMask));
-    SkASSERT(surface->asTexture()->texturePriv().textureType() == this->texPriv().textureType());
+    SkASSERT(surface->asTexture()->texturePriv().textureType() == this->textureType());
 }
 #endif
 
diff --git a/src/gpu/ccpr/GrCCAtlas.cpp b/src/gpu/ccpr/GrCCAtlas.cpp
index b336e8c..988d5fa 100644
--- a/src/gpu/ccpr/GrCCAtlas.cpp
+++ b/src/gpu/ccpr/GrCCAtlas.cpp
@@ -95,7 +95,7 @@
 
 bool GrCCAtlas::addRect(const SkIRect& devIBounds, SkIVector* offset) {
     // This can't be called anymore once makeRenderTargetContext() has been called.
-    SkASSERT(!fTextureProxy->priv().isInstantiated());
+    SkASSERT(!fTextureProxy->isInstantiated());
 
     SkIPoint16 location;
     if (!this->internalPlaceRect(devIBounds.width(), devIBounds.height(), &location)) {
@@ -136,7 +136,7 @@
 
 void GrCCAtlas::setUserBatchID(int id) {
     // This can't be called anymore once makeRenderTargetContext() has been called.
-    SkASSERT(!fTextureProxy->priv().isInstantiated());
+    SkASSERT(!fTextureProxy->isInstantiated());
     fUserBatchID = id;
 }
 
@@ -153,7 +153,7 @@
         builder[0] = next_atlas_unique_id();
         builder.finish();
 
-        if (fTextureProxy->priv().isInstantiated()) {
+        if (fTextureProxy->isInstantiated()) {
             onFlushRP->assignUniqueKeyToProxy(fUniqueKey, fTextureProxy.get());
         }
     }
@@ -169,7 +169,7 @@
 
 sk_sp<GrRenderTargetContext> GrCCAtlas::makeRenderTargetContext(
         GrOnFlushResourceProvider* onFlushRP, sk_sp<GrTexture> backingTexture) {
-    SkASSERT(!fTextureProxy->priv().isInstantiated());  // This method should only be called once.
+    SkASSERT(!fTextureProxy->isInstantiated());  // This method should only be called once.
     // Caller should have cropped any paths to the destination render target instead of asking for
     // an atlas larger than maxRenderTargetSize.
     SkASSERT(SkTMax(fHeight, fWidth) <= fMaxTextureSize);
diff --git a/src/gpu/ccpr/GrCCClipPath.cpp b/src/gpu/ccpr/GrCCClipPath.cpp
index 8629cc2..5702a96 100644
--- a/src/gpu/ccpr/GrCCClipPath.cpp
+++ b/src/gpu/ccpr/GrCCClipPath.cpp
@@ -38,7 +38,7 @@
                                     fDevToAtlasOffset.fY * fAtlasScale.y());
                 SkDEBUGCODE(fHasAtlasTransform = true);
 
-                return sk_ref_sp(textureProxy->priv().peekTexture());
+                return sk_ref_sp(textureProxy->peekTexture());
             },
             GrProxyProvider::Renderable::kYes, kTopLeft_GrSurfaceOrigin, kAlpha_half_GrPixelConfig,
             caps);
diff --git a/src/gpu/ccpr/GrCCPerFlushResources.cpp b/src/gpu/ccpr/GrCCPerFlushResources.cpp
index bc586be..aed1af7 100644
--- a/src/gpu/ccpr/GrCCPerFlushResources.cpp
+++ b/src/gpu/ccpr/GrCCPerFlushResources.cpp
@@ -287,7 +287,7 @@
         sk_sp<GrTexture> backingTexture;
         if (stashedAtlasProxy && atlas->currentWidth() == stashedAtlasProxy->width() &&
             atlas->currentHeight() == stashedAtlasProxy->height()) {
-            backingTexture = sk_ref_sp(stashedAtlasProxy->priv().peekTexture());
+            backingTexture = sk_ref_sp(stashedAtlasProxy->peekTexture());
             stashedAtlasProxy = nullptr;
         }
 
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index 6607efc..f17db09 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -107,7 +107,7 @@
                                   const GrFragmentProcessor& processor) {
     const GrBicubicEffect& bicubicEffect = processor.cast<GrBicubicEffect>();
     GrSurfaceProxy* proxy = processor.textureSampler(0).proxy();
-    GrTexture* texture = proxy->priv().peekTexture();
+    GrTexture* texture = proxy->peekTexture();
 
     float imageIncrement[2];
     imageIncrement[0] = 1.0f / texture->width();
diff --git a/src/gpu/effects/GrCircleBlurFragmentProcessor.cpp b/src/gpu/effects/GrCircleBlurFragmentProcessor.cpp
index 921d69b..02d84bb 100644
--- a/src/gpu/effects/GrCircleBlurFragmentProcessor.cpp
+++ b/src/gpu/effects/GrCircleBlurFragmentProcessor.cpp
@@ -299,7 +299,7 @@
         auto solidRadius = _outer.solidRadius();
         (void)solidRadius;
         GrSurfaceProxy& blurProfileSamplerProxy = *_outer.textureSampler(0).proxy();
-        GrTexture& blurProfileSampler = *blurProfileSamplerProxy.priv().peekTexture();
+        GrTexture& blurProfileSampler = *blurProfileSamplerProxy.peekTexture();
         (void)blurProfileSampler;
         UniformHandle& circleData = fCircleDataVar;
         (void)circleData;
diff --git a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
index f05bf42..57006de 100644
--- a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
+++ b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
@@ -121,7 +121,7 @@
     const GrGaussianConvolutionFragmentProcessor& conv =
             processor.cast<GrGaussianConvolutionFragmentProcessor>();
     GrSurfaceProxy* proxy = conv.textureSampler(0).proxy();
-    GrTexture& texture = *proxy->priv().peekTexture();
+    GrTexture& texture = *proxy->peekTexture();
 
     float imageIncrement[2] = {0};
     float ySign = proxy->origin() != kTopLeft_GrSurfaceOrigin ? 1.0f : -1.0f;
diff --git a/src/gpu/effects/GrMagnifierEffect.cpp b/src/gpu/effects/GrMagnifierEffect.cpp
index aadd541..ae53b33 100644
--- a/src/gpu/effects/GrMagnifierEffect.cpp
+++ b/src/gpu/effects/GrMagnifierEffect.cpp
@@ -83,7 +83,7 @@
             pdman.set1f(fYInvInsetVar, _outer.yInvInset());
         }
         GrSurfaceProxy& srcProxy = *_outer.textureSampler(0).proxy();
-        GrTexture& src = *srcProxy.priv().peekTexture();
+        GrTexture& src = *srcProxy.peekTexture();
         (void)src;
         auto bounds = _outer.bounds();
         (void)bounds;
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index ccb32cf..123728f 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -126,7 +126,7 @@
                                             const GrFragmentProcessor& processor) {
     const GrMatrixConvolutionEffect& conv = processor.cast<GrMatrixConvolutionEffect>();
     GrSurfaceProxy* proxy = conv.textureSampler(0).proxy();
-    GrTexture* texture = proxy->priv().peekTexture();
+    GrTexture* texture = proxy->peekTexture();
 
     float imageIncrement[2];
     float ySign = proxy->origin() == kTopLeft_GrSurfaceOrigin ? 1.0f : -1.0f;
diff --git a/src/gpu/effects/GrRRectBlurEffect.cpp b/src/gpu/effects/GrRRectBlurEffect.cpp
index 6101f24..e9659f5 100644
--- a/src/gpu/effects/GrRRectBlurEffect.cpp
+++ b/src/gpu/effects/GrRRectBlurEffect.cpp
@@ -108,7 +108,7 @@
         UniformHandle& cornerRadius = fCornerRadiusVar;
         (void)cornerRadius;
         GrSurfaceProxy& ninePatchSamplerProxy = *_outer.textureSampler(0).proxy();
-        GrTexture& ninePatchSampler = *ninePatchSamplerProxy.priv().peekTexture();
+        GrTexture& ninePatchSampler = *ninePatchSamplerProxy.peekTexture();
         (void)ninePatchSampler;
         UniformHandle& proxyRect = fProxyRectVar;
         (void)proxyRect;
diff --git a/src/gpu/effects/GrRectBlurEffect.cpp b/src/gpu/effects/GrRectBlurEffect.cpp
index 0e99bc0..7b7b658 100644
--- a/src/gpu/effects/GrRectBlurEffect.cpp
+++ b/src/gpu/effects/GrRectBlurEffect.cpp
@@ -114,7 +114,7 @@
         auto sigma = _outer.sigma();
         (void)sigma;
         GrSurfaceProxy& blurProfileProxy = *_outer.textureSampler(0).proxy();
-        GrTexture& blurProfile = *blurProfileProxy.priv().peekTexture();
+        GrTexture& blurProfile = *blurProfileProxy.peekTexture();
         (void)blurProfile;
         UniformHandle& proxyRectHalf = fProxyRectHalfVar;
         (void)proxyRectHalf;
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index ee27cc0..d8df5ac 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -162,7 +162,7 @@
 void GrTextureDomain::GLDomain::setData(const GrGLSLProgramDataManager& pdman,
                                         const GrTextureDomain& textureDomain,
                                         GrSurfaceProxy* proxy) {
-    GrTexture* tex = proxy->priv().peekTexture();
+    GrTexture* tex = proxy->peekTexture();
     SkASSERT(fHasMode && textureDomain.mode() == fMode);
     if (kIgnore_Mode != textureDomain.mode()) {
         SkScalar wInv = SK_Scalar1 / tex->width();
@@ -383,7 +383,7 @@
             const GrDeviceSpaceTextureDecalFragmentProcessor& dstdfp =
                     fp.cast<GrDeviceSpaceTextureDecalFragmentProcessor>();
             GrSurfaceProxy* proxy = dstdfp.textureSampler(0).proxy();
-            GrTexture* texture = proxy->priv().peekTexture();
+            GrTexture* texture = proxy->peekTexture();
 
             fGLDomain.setData(pdman, dstdfp.fTextureDomain, proxy);
             float iw = 1.f / texture->width();
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 0fc8843..c0549e9 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -2185,8 +2185,8 @@
     const GrTextureProxy* dstTex = dst->asTextureProxy();
     const GrTextureProxy* srcTex = src->asTextureProxy();
 
-    bool dstIsTex2D = dstTex ? (dstTex->texPriv().textureType() == GrTextureType::k2D) : false;
-    bool srcIsTex2D = srcTex ? (srcTex->texPriv().textureType() == GrTextureType::k2D) : false;
+    bool dstIsTex2D = dstTex ? (dstTex->textureType() == GrTextureType::k2D) : false;
+    bool srcIsTex2D = srcTex ? (srcTex->textureType() == GrTextureType::k2D) : false;
 
     // One of the possible requirements for copy as blit is that the srcRect must match the bounds
     // of the src surface. If we have a approx fit surface we can't know for sure what the src
@@ -2234,7 +2234,7 @@
     {
         // The only way we could see a non-GR_GL_TEXTURE_2D texture would be if it were
         // wrapped. In that case the proxy would already be instantiated.
-        const GrTexture* srcTexture = src->priv().peekTexture();
+        const GrTexture* srcTexture = src->peekTexture();
         const GrGLTexture* glSrcTexture = static_cast<const GrGLTexture*>(srcTexture);
         if (glSrcTexture && glSrcTexture->target() != GR_GL_TEXTURE_2D) {
             // Not supported for FBO blit or CopyTexSubImage
diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp
index 85c129f..8bd4c9c 100644
--- a/src/gpu/gl/GrGLPathRendering.cpp
+++ b/src/gpu/gl/GrGLPathRendering.cpp
@@ -87,7 +87,7 @@
     SkASSERT(gpu->caps()->shaderCaps()->pathRenderingSupport());
     gpu->flushColorWrite(false);
 
-    GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(args.fProxy->priv().peekRenderTarget());
+    GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(args.fProxy->peekRenderTarget());
     SkISize size = SkISize::Make(rt->width(), rt->height());
     this->setProjectionMatrix(*args.fViewMatrix, size, args.fProxy->origin());
     gpu->flushScissor(*args.fScissor, rt->getViewport(), args.fProxy->origin());
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index a392bc2..6bffe56 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -149,7 +149,7 @@
 
 void GrGLProgram::setRenderTargetState(const GrPrimitiveProcessor& primProc,
                                        const GrRenderTargetProxy* proxy) {
-    GrRenderTarget* rt = proxy->priv().peekRenderTarget();
+    GrRenderTarget* rt = proxy->peekRenderTarget();
     // Load the RT height uniform if it is needed to y-flip gl_FragCoord.
     if (fBuiltinUniformHandles.fRTHeightUni.isValid() &&
         fRenderTargetState.fRenderTargetSize.fHeight != rt->height()) {
diff --git a/src/gpu/ops/GrCopySurfaceOp.cpp b/src/gpu/ops/GrCopySurfaceOp.cpp
index a90579b..2410e51 100644
--- a/src/gpu/ops/GrCopySurfaceOp.cpp
+++ b/src/gpu/ops/GrCopySurfaceOp.cpp
@@ -88,6 +88,6 @@
         return;
     }
 
-    state->commandBuffer()->copy(fSrc.get()->priv().peekSurface(), fSrc.get()->origin(),
-                                 fSrcRect, fDstPoint);
+    state->commandBuffer()->copy(fSrc.get()->peekSurface(), fSrc.get()->origin(), fSrcRect,
+                                 fDstPoint);
 }
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index 9b2baeb..c69eecc 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -842,7 +842,7 @@
         float iw[kMaxTextures];
         float ih[kMaxTextures];
         for (int t = 0; t < fProxyCnt; ++t) {
-            const auto* texture = proxies[t]->priv().peekTexture();
+            const auto* texture = proxies[t]->peekTexture();
             iw[t] = 1.f / texture->width();
             ih[t] = 1.f / texture->height();
         }
@@ -986,7 +986,7 @@
             if (thatProxies[j]->config() != config) {
                 return -1;
             }
-            if (GrTexture* tex = thatProxies[j]->priv().peekTexture()) {
+            if (GrTexture* tex = thatProxies[j]->peekTexture()) {
                 if (tex->texturePriv().textureType() != GrTextureType::k2D) {
                     return -1;
                 }
diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp
index 8870f41..04a85a4 100644
--- a/src/gpu/vk/GrVkPipelineState.cpp
+++ b/src/gpu/vk/GrVkPipelineState.cpp
@@ -209,9 +209,9 @@
     }
 
     if (GrTextureProxy* dstTextureProxy = pipeline.dstTextureProxy()) {
-        samplerBindings[currTextureBinding++] =
-                {GrSamplerState::ClampNearest(),
-                 static_cast<GrVkTexture*>(dstTextureProxy->priv().peekTexture())};
+        samplerBindings[currTextureBinding++] = {
+                GrSamplerState::ClampNearest(),
+                static_cast<GrVkTexture*>(dstTextureProxy->peekTexture())};
     }
 
     // Get new descriptor sets
@@ -345,7 +345,7 @@
 }
 
 void GrVkPipelineState::setRenderTargetState(const GrRenderTargetProxy* proxy) {
-    GrRenderTarget* rt = proxy->priv().peekRenderTarget();
+    GrRenderTarget* rt = proxy->peekRenderTarget();
 
     // Load the RT height uniform if it is needed to y-flip gl_FragCoord.
     if (fBuiltinUniformHandles.fRTHeightUni.isValid() &&
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 58aa1bc..556373d 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -160,7 +160,7 @@
                                                   GrSurfaceOrigin* origin) const {
     SkASSERT(fProxy);
 
-    if (!fContext->contextPriv().resourceProvider() && !fProxy->priv().isInstantiated()) {
+    if (!fContext->contextPriv().resourceProvider() && !fProxy->isInstantiated()) {
         // This image was created with a DDL context and cannot be instantiated.
         return GrBackendTexture();
     }
@@ -169,7 +169,7 @@
         return GrBackendTexture(); // invalid
     }
 
-    GrTexture* texture = fProxy->priv().peekTexture();
+    GrTexture* texture = fProxy->peekTexture();
 
     if (texture) {
         if (flushPendingGrContextIO) {
@@ -189,7 +189,7 @@
         return nullptr;
     }
 
-    if (!fContext->contextPriv().resourceProvider() && !fProxy->priv().isInstantiated()) {
+    if (!fContext->contextPriv().resourceProvider() && !fProxy->isInstantiated()) {
         // This image was created with a DDL context and cannot be instantiated.
         return nullptr;
     }
@@ -198,7 +198,7 @@
         return nullptr;
     }
 
-    return proxy->priv().peekTexture();
+    return proxy->peekTexture();
 }
 
 bool SkImage_Gpu::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRB,
@@ -776,7 +776,7 @@
     if (!proxy->instantiate(context->contextPriv().resourceProvider())) {
         return codecImage;
     }
-    sk_sp<GrTexture> texture = sk_ref_sp(proxy->priv().peekTexture());
+    sk_sp<GrTexture> texture = sk_ref_sp(proxy->peekTexture());
 
     // Flush any writes or uploads
     context->contextPriv().prepareSurfaceForExternalIO(proxy.get());
@@ -845,7 +845,7 @@
         return SkImage::MakeRasterCopy(*pixmap);
     }
 
-    sk_sp<GrTexture> texture = sk_ref_sp(proxy->priv().peekTexture());
+    sk_sp<GrTexture> texture = sk_ref_sp(proxy->peekTexture());
 
     // Flush any writes or uploads
     context->contextPriv().prepareSurfaceForExternalIO(proxy.get());
diff --git a/src/sksl/SkSLCPPCodeGenerator.cpp b/src/sksl/SkSLCPPCodeGenerator.cpp
index 8656501..b73977d 100644
--- a/src/sksl/SkSLCPPCodeGenerator.cpp
+++ b/src/sksl/SkSLCPPCodeGenerator.cpp
@@ -610,7 +610,7 @@
                         this->writef("        GrSurfaceProxy& %sProxy = "
                                      "*_outer.textureSampler(%d).proxy();\n",
                                      name, samplerIndex);
-                        this->writef("        GrTexture& %s = *%sProxy.priv().peekTexture();\n",
+                        this->writef("        GrTexture& %s = *%sProxy.peekTexture();\n",
                                      name, name);
                         this->writef("        (void) %s;\n", name);
                         ++samplerIndex;
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index 498e60d..2cfeaae 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -1511,7 +1511,7 @@
         stack.clipPath(path, m, SkClipOp::kIntersect, true);
         sk_sp<GrTextureProxy> mask = GrClipStackClip(&stack).testingOnly_createClipMask(context);
         mask->instantiate(context->contextPriv().resourceProvider());
-        GrTexture* tex = mask->priv().peekTexture();
+        GrTexture* tex = mask->peekTexture();
         REPORTER_ASSERT(reporter, 0 == strcmp(tex->getUniqueKey().tag(), kTag));
         // Make sure mask isn't pinned in cache.
         mask.reset(nullptr);
diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp
index ff25d68..98f2d97 100644
--- a/tests/DeferredDisplayListTest.cpp
+++ b/tests/DeferredDisplayListTest.cpp
@@ -873,9 +873,9 @@
 
             REPORTER_ASSERT(reporter, backingProxy->mipMapped() == mipMapped);
             if (GR_GL_TEXTURE_2D == target) {
-                REPORTER_ASSERT(reporter, !backingProxy->texPriv().hasRestrictedSampling());
+                REPORTER_ASSERT(reporter, !backingProxy->hasRestrictedSampling());
             } else {
-                REPORTER_ASSERT(reporter, backingProxy->texPriv().hasRestrictedSampling());
+                REPORTER_ASSERT(reporter, backingProxy->hasRestrictedSampling());
             }
         }
     }
diff --git a/tests/DrawOpAtlasTest.cpp b/tests/DrawOpAtlasTest.cpp
index 97524cd..6993430 100644
--- a/tests/DrawOpAtlasTest.cpp
+++ b/tests/DrawOpAtlasTest.cpp
@@ -47,7 +47,7 @@
 int GrDrawOpAtlas::numAllocated_TestingOnly() const {
     int count = 0;
     for (uint32_t i = 0; i < this->maxPages(); ++i) {
-        if (fProxies[i]->priv().isInstantiated()) {
+        if (fProxies[i]->isInstantiated()) {
             ++count;
         }
     }
diff --git a/tests/EGLImageTest.cpp b/tests/EGLImageTest.cpp
index 73dd761..b646415 100644
--- a/tests/EGLImageTest.cpp
+++ b/tests/EGLImageTest.cpp
@@ -169,15 +169,13 @@
 
     GrTextureProxy* proxy = surfaceContext->asTextureProxy();
     REPORTER_ASSERT(reporter, proxy->mipMapped() == GrMipMapped::kNo);
-    REPORTER_ASSERT(reporter,
-                    proxy->priv().peekTexture()->texturePriv().mipMapped() == GrMipMapped::kNo);
+    REPORTER_ASSERT(reporter, proxy->peekTexture()->texturePriv().mipMapped() == GrMipMapped::kNo);
 
-    REPORTER_ASSERT(reporter, proxy->texPriv().textureType() == GrTextureType::kExternal);
-    REPORTER_ASSERT(
-            reporter,
-            proxy->priv().peekTexture()->texturePriv().textureType() == GrTextureType::kExternal);
-    REPORTER_ASSERT(reporter, proxy->texPriv().hasRestrictedSampling());
-    REPORTER_ASSERT(reporter, proxy->priv().peekTexture()->texturePriv().hasRestrictedSampling());
+    REPORTER_ASSERT(reporter, proxy->textureType() == GrTextureType::kExternal);
+    REPORTER_ASSERT(reporter,
+                    proxy->peekTexture()->texturePriv().textureType() == GrTextureType::kExternal);
+    REPORTER_ASSERT(reporter, proxy->hasRestrictedSampling());
+    REPORTER_ASSERT(reporter, proxy->peekTexture()->texturePriv().hasRestrictedSampling());
 
     // Should not be able to wrap as a RT
     {
diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp
index 4c93714..d4571d1 100644
--- a/tests/GrMipMappedTest.cpp
+++ b/tests/GrMipMappedTest.cpp
@@ -73,9 +73,9 @@
                 return;
             }
 
-            REPORTER_ASSERT(reporter, proxy->priv().isInstantiated());
+            REPORTER_ASSERT(reporter, proxy->isInstantiated());
 
-            GrTexture* texture = proxy->priv().peekTexture();
+            GrTexture* texture = proxy->peekTexture();
             REPORTER_ASSERT(reporter, texture);
             if (!texture) {
                 gpu->deleteTestingOnlyBackendTexture(backendTex);
@@ -124,9 +124,9 @@
                 return;
             }
 
-            REPORTER_ASSERT(reporter, proxy->priv().isInstantiated());
+            REPORTER_ASSERT(reporter, proxy->isInstantiated());
 
-            sk_sp<GrTexture> texture = sk_ref_sp(proxy->priv().peekTexture());
+            sk_sp<GrTexture> texture = sk_ref_sp(proxy->peekTexture());
             REPORTER_ASSERT(reporter, texture);
             if (!texture) {
                 gpu->deleteTestingOnlyBackendTexture(backendTex);
@@ -156,17 +156,17 @@
 
             if (GrSurfaceProxy::LazyState::kNot != genProxy->lazyInstantiationState()) {
                 genProxy->priv().doLazyInstantiation(context->contextPriv().resourceProvider());
-            } else if (!genProxy->priv().isInstantiated()) {
+            } else if (!genProxy->isInstantiated()) {
                 genProxy->instantiate(context->contextPriv().resourceProvider());
             }
 
-            REPORTER_ASSERT(reporter, genProxy->priv().isInstantiated());
-            if (!genProxy->priv().isInstantiated()) {
+            REPORTER_ASSERT(reporter, genProxy->isInstantiated());
+            if (!genProxy->isInstantiated()) {
                 gpu->deleteTestingOnlyBackendTexture(backendTex);
                 return;
             }
 
-            GrTexture* genTexture = genProxy->priv().peekTexture();
+            GrTexture* genTexture = genProxy->peekTexture();
             REPORTER_ASSERT(reporter, genTexture);
             if (!genTexture) {
                 gpu->deleteTestingOnlyBackendTexture(backendTex);
@@ -260,7 +260,7 @@
             REPORTER_ASSERT(reporter, mipMapped == texProxy->mipMapped());
 
             texProxy->instantiate(resourceProvider);
-            GrTexture* texture = texProxy->priv().peekTexture();
+            GrTexture* texture = texProxy->peekTexture();
             REPORTER_ASSERT(reporter, mipMapped == texture->texturePriv().mipMapped());
 
             sk_sp<SkImage> image = surface->makeImageSnapshot();
@@ -272,7 +272,7 @@
             REPORTER_ASSERT(reporter, mipMapped == texProxy->mipMapped());
 
             texProxy->instantiate(resourceProvider);
-            texture = texProxy->priv().peekTexture();
+            texture = texProxy->peekTexture();
             REPORTER_ASSERT(reporter, mipMapped == texture->texturePriv().mipMapped());
 
             // Must flush the context to make sure all the cmds (copies, etc.) from above are sent
diff --git a/tests/ImageFilterCacheTest.cpp b/tests/ImageFilterCacheTest.cpp
index e651b33..13112e9 100644
--- a/tests/ImageFilterCacheTest.cpp
+++ b/tests/ImageFilterCacheTest.cpp
@@ -224,7 +224,7 @@
     if (!srcProxy->instantiate(context->contextPriv().resourceProvider())) {
         return;
     }
-    GrTexture* tex = srcProxy->priv().peekTexture();
+    GrTexture* tex = srcProxy->peekTexture();
 
     GrBackendTexture backendTex = tex->getBackendTexture();
 
diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp
index 3881251..99f9d2a 100644
--- a/tests/LazyProxyTest.cpp
+++ b/tests/LazyProxyTest.cpp
@@ -131,7 +131,7 @@
                                     REPORTER_ASSERT(fTest->fReporter, !fTest->fHasClipTexture);
                                     fTest->fHasClipTexture = true;
                                     fAtlas->instantiate(rp);
-                                    return sk_ref_sp(fAtlas->priv().peekTexture());
+                                    return sk_ref_sp(fAtlas->peekTexture());
                                 },
                                 GrProxyProvider::Renderable::kYes,
                                 kBottomLeft_GrSurfaceOrigin,
diff --git a/tests/ProxyConversionTest.cpp b/tests/ProxyConversionTest.cpp
index 4a95d48..777e9fd 100644
--- a/tests/ProxyConversionTest.cpp
+++ b/tests/ProxyConversionTest.cpp
@@ -35,8 +35,8 @@
 
 void clean_up_wrapped_rt(GrGpu* gpu, sk_sp<GrSurfaceProxy> proxy) {
     SkASSERT(proxy->isUnique_debugOnly());
-    SkASSERT(proxy->priv().peekRenderTarget());
-    GrBackendRenderTarget rt = proxy->priv().peekRenderTarget()->getBackendRenderTarget();
+    SkASSERT(proxy->peekRenderTarget());
+    GrBackendRenderTarget rt = proxy->peekRenderTarget()->getBackendRenderTarget();
     proxy.reset();
     gpu->deleteTestingOnlyBackendRenderTarget(rt);
 }
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 406d1d1..69db12d 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -47,9 +47,9 @@
     REPORTER_ASSERT(reporter, rtProxy->numStencilSamples() == numSamples);
 
     GrSurfaceProxy::UniqueID idBefore = rtProxy->uniqueID();
-    bool preinstantiated = rtProxy->priv().isInstantiated();
+    bool preinstantiated = rtProxy->isInstantiated();
     REPORTER_ASSERT(reporter, rtProxy->instantiate(provider));
-    GrRenderTarget* rt = rtProxy->priv().peekRenderTarget();
+    GrRenderTarget* rt = rtProxy->peekRenderTarget();
 
     REPORTER_ASSERT(reporter, rtProxy->uniqueID() == idBefore);
     // Deferred resources should always have a different ID from their instantiated rendertarget
@@ -80,9 +80,9 @@
                           SkBackingFit fit) {
     GrSurfaceProxy::UniqueID idBefore = texProxy->uniqueID();
 
-    bool preinstantiated = texProxy->priv().isInstantiated();
+    bool preinstantiated = texProxy->isInstantiated();
     REPORTER_ASSERT(reporter, texProxy->instantiate(provider));
-    GrTexture* tex = texProxy->priv().peekTexture();
+    GrTexture* tex = texProxy->peekTexture();
 
     REPORTER_ASSERT(reporter, texProxy->uniqueID() == idBefore);
     // Deferred resources should always have a different ID from their instantiated texture
diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp
index 68e4fea..1d7c303 100644
--- a/tests/RectangleTextureTest.cpp
+++ b/tests/RectangleTextureTest.cpp
@@ -139,13 +139,13 @@
         }
 
         SkASSERT(rectProxy->mipMapped() == GrMipMapped::kNo);
-        SkASSERT(rectProxy->priv().peekTexture()->texturePriv().mipMapped() == GrMipMapped::kNo);
+        SkASSERT(rectProxy->peekTexture()->texturePriv().mipMapped() == GrMipMapped::kNo);
 
-        SkASSERT(rectProxy->texPriv().textureType() == GrTextureType::kRectangle);
-        SkASSERT(rectProxy->priv().peekTexture()->texturePriv().textureType() ==
+        SkASSERT(rectProxy->textureType() == GrTextureType::kRectangle);
+        SkASSERT(rectProxy->peekTexture()->texturePriv().textureType() ==
                  GrTextureType::kRectangle);
-        SkASSERT(rectProxy->texPriv().hasRestrictedSampling());
-        SkASSERT(rectProxy->priv().peekTexture()->texturePriv().hasRestrictedSampling());
+        SkASSERT(rectProxy->hasRestrictedSampling());
+        SkASSERT(rectProxy->peekTexture()->texturePriv().hasRestrictedSampling());
 
         test_basic_draw_as_src(reporter, context, rectProxy, refPixels);
 
diff --git a/tests/ResourceAllocatorTest.cpp b/tests/ResourceAllocatorTest.cpp
index 852fe5a..4751803 100644
--- a/tests/ResourceAllocatorTest.cpp
+++ b/tests/ResourceAllocatorTest.cpp
@@ -91,8 +91,8 @@
     alloc.assign(&startIndex, &stopIndex, &uninstantiateTracker, &error);
     REPORTER_ASSERT(reporter, GrResourceAllocator::AssignError::kNoError == error);
 
-    REPORTER_ASSERT(reporter, p1->priv().peekSurface());
-    REPORTER_ASSERT(reporter, p2->priv().peekSurface());
+    REPORTER_ASSERT(reporter, p1->peekSurface());
+    REPORTER_ASSERT(reporter, p2->peekSurface());
     bool doTheBackingStoresMatch = p1->underlyingUniqueID() == p2->underlyingUniqueID();
     REPORTER_ASSERT(reporter, expectedResult == doTheBackingStoresMatch);
 }
@@ -114,8 +114,8 @@
     alloc.assign(&startIndex, &stopIndex, &uninstantiateTracker, &error);
     REPORTER_ASSERT(reporter, GrResourceAllocator::AssignError::kNoError == error);
 
-    REPORTER_ASSERT(reporter, p1->priv().peekSurface());
-    REPORTER_ASSERT(reporter, p2->priv().peekSurface());
+    REPORTER_ASSERT(reporter, p1->peekSurface());
+    REPORTER_ASSERT(reporter, p2->peekSurface());
     bool doTheBackingStoresMatch = p1->underlyingUniqueID() == p2->underlyingUniqueID();
     REPORTER_ASSERT(reporter, expectedResult == doTheBackingStoresMatch);
 }
diff --git a/tests/TextureProxyTest.cpp b/tests/TextureProxyTest.cpp
index da072b5..5def7b2 100644
--- a/tests/TextureProxyTest.cpp
+++ b/tests/TextureProxyTest.cpp
@@ -150,7 +150,7 @@
 
     // Once instantiated, the backing resource should have the same key
     SkAssertResult(proxy->instantiate(resourceProvider));
-    const GrUniqueKey& texKey = proxy->priv().peekSurface()->getUniqueKey();
+    const GrUniqueKey& texKey = proxy->peekSurface()->getUniqueKey();
     REPORTER_ASSERT(reporter, texKey.isValid());
     REPORTER_ASSERT(reporter, key == texKey);
     if (proxyIsCached) {
@@ -266,7 +266,7 @@
     SkAssertResult(proxy->instantiate(resourceProvider));
 
     REPORTER_ASSERT(reporter, !proxy->getUniqueKey().isValid());
-    REPORTER_ASSERT(reporter, !proxy->priv().peekTexture()->getUniqueKey().isValid());
+    REPORTER_ASSERT(reporter, !proxy->peekTexture()->getUniqueKey().isValid());
     REPORTER_ASSERT(reporter, 0 == proxyProvider->numUniqueKeyProxies_TestOnly());
     REPORTER_ASSERT(reporter, 1 == cache->getResourceCount());
 
diff --git a/tests/VkBackendSurfaceTest.cpp b/tests/VkBackendSurfaceTest.cpp
index c5d707b..3245afd 100644
--- a/tests/VkBackendSurfaceTest.cpp
+++ b/tests/VkBackendSurfaceTest.cpp
@@ -64,8 +64,8 @@
 
     sk_sp<GrTextureProxy> texProxy = as_IB(wrappedImage)->asTextureProxyRef();
     REPORTER_ASSERT(reporter, texProxy.get());
-    REPORTER_ASSERT(reporter, texProxy->priv().isInstantiated());
-    GrTexture* texture = texProxy->priv().peekTexture();
+    REPORTER_ASSERT(reporter, texProxy->isInstantiated());
+    GrTexture* texture = texProxy->peekTexture();
     REPORTER_ASSERT(reporter, texture);
 
     // Verify that modifying the layout via the GrVkTexture is reflected in the GrBackendTexture