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/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