Omnibus: Push instantiation of GrTextures later (post TextureSampler)


Split into:
   https://skia-review.googlesource.com/c/10485/ (More GrSurfaceProxy-clean up)
   https://skia-review.googlesource.com/c/15819/ (Expand GrTextureProxy to handle highestFilterMode)
   https://skia-review.googlesource.com/c/16714/ (Switch ImageStorageAccess over to GrTextureProxies)
   https://skia-review.googlesource.com/c/16908/ (Convert DstTexture to DstProxy)

Change-Id: I6cf3ba0f3bf0e1908d36749bc83571c066ddd568
Reviewed-on: https://skia-review.googlesource.com/10484
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp
index 0bce078..51cfdfb 100644
--- a/src/gpu/GrProcessor.cpp
+++ b/src/gpu/GrProcessor.cpp
@@ -143,7 +143,7 @@
 
 void GrResourceIOProcessor::addPendingIOs() const {
     for (const auto& sampler : fTextureSamplers) {
-        sampler->programTexture()->markPendingIO();
+        sampler->programProxy()->markPendingIO();
     }
     for (const auto& buffer : fBufferAccesses) {
         buffer->programBuffer()->markPendingIO();
@@ -155,7 +155,7 @@
 
 void GrResourceIOProcessor::removeRefs() const {
     for (const auto& sampler : fTextureSamplers) {
-        sampler->programTexture()->removeRef();
+        sampler->programProxy()->removeRef();
     }
     for (const auto& buffer : fBufferAccesses) {
         buffer->programBuffer()->removeRef();
@@ -167,7 +167,7 @@
 
 void GrResourceIOProcessor::pendingIOComplete() const {
     for (const auto& sampler : fTextureSamplers) {
-        sampler->programTexture()->pendingIOComplete();
+        sampler->programProxy()->pendingIOComplete();
     }
     for (const auto& buffer : fBufferAccesses) {
         buffer->programBuffer()->pendingIOComplete();
@@ -242,16 +242,8 @@
                                                   const GrSamplerParams& params,
                                                   GrShaderFlags visibility) {
     fParams = params;
-
-    // For now, end the deferral at this time. Once all the TextureSamplers are swapped over
-    // to taking a GrSurfaceProxy just use the IORefs on the proxy
-    GrTexture* texture = proxy->instantiateTexture(resourceProvider);
-    if (texture) {
-        fTexture.set(SkRef(texture), kRead_GrIOType);
-        SkASSERT(texture->texturePriv().highestFilterMode() == proxy->highestFilterMode());
-        fParams.setFilterMode(SkTMin(params.filterMode(), proxy->highestFilterMode()));
-    }
-
+    fProxyRef.setProxy(std::move(proxy), kRead_GrIOType);
+    fParams.setFilterMode(SkTMin(params.filterMode(), this->proxy()->highestFilterMode()));
     fVisibility = visibility;
 }
 
@@ -260,15 +252,8 @@
                                                   GrSamplerParams::FilterMode filterMode,
                                                   SkShader::TileMode tileXAndY,
                                                   GrShaderFlags visibility) {
-    // For now, end the deferral at this time. Once all the TextureSamplers are swapped over
-    // to taking a GrSurfaceProxy just use the IORefs on the proxy
-    GrTexture* texture = proxy->instantiateTexture(resourceProvider);
-    if (texture) {
-        fTexture.set(SkRef(texture), kRead_GrIOType);
-        SkASSERT(texture->texturePriv().highestFilterMode() == proxy->highestFilterMode());
-        filterMode = SkTMin(filterMode, proxy->highestFilterMode());
-    }
-
+    fProxyRef.setProxy(std::move(proxy), kRead_GrIOType);
+    filterMode = SkTMin(filterMode, this->proxy()->highestFilterMode());
     fParams.reset(tileXAndY, filterMode);
     fVisibility = visibility;
 }