Add GrSurfaceProxyView to the various draw atlas ops.

Bug: skia:9556
Change-Id: I9eb825ab241fd0d0d4e63408af270a89e872d1c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258802
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/atlastext/SkAtlasTextTarget.cpp b/src/atlastext/SkAtlasTextTarget.cpp
index 32802f8..9a94ce5 100644
--- a/src/atlastext/SkAtlasTextTarget.cpp
+++ b/src/atlastext/SkAtlasTextTarget.cpp
@@ -224,7 +224,7 @@
     auto resourceProvider = context.grContext()->priv().resourceProvider();
 
     unsigned int numProxies;
-    if (!atlasManager->getProxies(kA8_GrMaskFormat, &numProxies)) {
+    if (!atlasManager->getViews(kA8_GrMaskFormat, &numProxies)) {
         return;
     }
 
diff --git a/src/atlastext/SkInternalAtlasTextContext.cpp b/src/atlastext/SkInternalAtlasTextContext.cpp
index 725be72..9087843 100644
--- a/src/atlastext/SkInternalAtlasTextContext.cpp
+++ b/src/atlastext/SkInternalAtlasTextContext.cpp
@@ -41,7 +41,7 @@
         auto atlasManager = fGrContext->priv().getAtlasManager();
         if (atlasManager) {
             unsigned int numProxies;
-            atlasManager->getProxies(kA8_GrMaskFormat, &numProxies);
+            atlasManager->getViews(kA8_GrMaskFormat, &numProxies);
             SkASSERT(1 == numProxies);
         }
 #endif
@@ -91,7 +91,8 @@
     auto* atlasManager = fGrContext->priv().getAtlasManager();
     if (!fDistanceFieldAtlas.fProxy) {
         unsigned int numProxies;
-        fDistanceFieldAtlas.fProxy = atlasManager->getProxies(kA8_GrMaskFormat, &numProxies)->get();
+        fDistanceFieldAtlas.fProxy =
+                atlasManager->getViews(kA8_GrMaskFormat, &numProxies)->asTextureProxy();
         SkASSERT(1 == numProxies);
         fDistanceFieldAtlas.fTextureHandle =
                 fRenderer->createTexture(SkAtlasTextRenderer::AtlasFormat::kA8,
diff --git a/src/gpu/GrContextPriv.cpp b/src/gpu/GrContextPriv.cpp
index 4a4bd3c..b4ae5f6 100644
--- a/src/gpu/GrContextPriv.cpp
+++ b/src/gpu/GrContextPriv.cpp
@@ -285,14 +285,15 @@
     }
 
     unsigned int numActiveProxies;
-    const sk_sp<GrTextureProxy>* proxies = atlasManager->getProxies(format, &numActiveProxies);
-    if (index >= numActiveProxies || !proxies || !proxies[index]) {
+    const GrSurfaceProxyView* views = atlasManager->getViews(format, &numActiveProxies);
+    if (index >= numActiveProxies || !views || !views[index].proxy()) {
         return nullptr;
     }
 
-    SkASSERT(proxies[index]->priv().isExact());
+    SkASSERT(views[index].proxy()->priv().isExact());
     sk_sp<SkImage> image(new SkImage_Gpu(sk_ref_sp(fContext), kNeedNewImageUniqueID,
-                                         kPremul_SkAlphaType, proxies[index], nullptr));
+                                         kPremul_SkAlphaType, views[index].asTextureProxyRef(),
+                                         nullptr));
     return image;
 }
 
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index e91f223b..03a96f6 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -32,7 +32,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]->isInstantiated());
+        SkASSERT(fViews[i].proxy() && fViews[i].proxy()->isInstantiated());
     }
 }
 
@@ -49,7 +49,7 @@
     std::unique_ptr<GrDrawOpAtlas> atlas(new GrDrawOpAtlas(proxyProvider, format, colorType, width,
                                                            height, plotWidth, plotHeight,
                                                            allowMultitexturing));
-    if (!atlas->getProxies()[0]) {
+    if (!atlas->getViews()[0].proxy()) {
         return nullptr;
     }
 
@@ -227,8 +227,8 @@
         // With c+14 we could move sk_sp into lamba to only ref once.
         sk_sp<Plot> plotsp(SkRef(plot));
 
-        GrTextureProxy* proxy = fProxies[pageIdx].get();
-        SkASSERT(proxy->isInstantiated());  // This is occurring at flush time
+        GrTextureProxy* proxy = fViews[pageIdx].asTextureProxy();
+        SkASSERT(proxy && proxy->isInstantiated());  // This is occurring at flush time
 
         GrDeferredUploadToken lastUploadToken = target->addASAPUpload(
                 [plotsp, proxy](GrDeferredTextureUploadWritePixelsFn& writePixels) {
@@ -243,14 +243,14 @@
 bool GrDrawOpAtlas::uploadToPage(const GrCaps& caps, unsigned int pageIdx, AtlasID* id,
                                  GrDeferredUploadTarget* target, int width, int height,
                                  const void* image, SkIPoint16* loc) {
-    SkASSERT(fProxies[pageIdx] && fProxies[pageIdx]->isInstantiated());
+    SkASSERT(fViews[pageIdx].proxy() && fViews[pageIdx].proxy()->isInstantiated());
 
     // look through all allocated plots for one we can share, in Most Recently Refed order
     PlotList::Iter plotIter;
     plotIter.init(fPages[pageIdx].fPlotList, PlotList::Iter::kHead_IterStart);
 
     for (Plot* plot = plotIter.get(); plot; plot = plotIter.next()) {
-        SkASSERT(caps.bytesPerPixel(fProxies[pageIdx]->backendFormat()) == plot->bpp());
+        SkASSERT(caps.bytesPerPixel(fViews[pageIdx].proxy()->backendFormat()) == plot->bpp());
 
         if (plot->addSubImage(width, height, image, loc)) {
             return this->updatePlot(target, id, plot);
@@ -298,7 +298,8 @@
             SkASSERT(plot);
             if (plot->lastUseToken() < target->tokenTracker()->nextTokenToFlush()) {
                 this->processEvictionAndResetRects(plot);
-                SkASSERT(caps.bytesPerPixel(fProxies[pageIdx]->backendFormat()) == plot->bpp());
+                SkASSERT(caps.bytesPerPixel(fViews[pageIdx].proxy()->backendFormat()) ==
+                         plot->bpp());
                 SkDEBUGCODE(bool verify = )plot->addSubImage(width, height, image, loc);
                 SkASSERT(verify);
                 if (!this->updatePlot(target, id, plot)) {
@@ -353,7 +354,7 @@
     newPlot.reset(plot->clone());
 
     fPages[pageIdx].fPlotList.addToHead(newPlot.get());
-    SkASSERT(caps.bytesPerPixel(fProxies[pageIdx]->backendFormat()) == newPlot->bpp());
+    SkASSERT(caps.bytesPerPixel(fViews[pageIdx].proxy()->backendFormat()) == newPlot->bpp());
     SkDEBUGCODE(bool verify = )newPlot->addSubImage(width, height, image, loc);
     SkASSERT(verify);
 
@@ -362,8 +363,8 @@
     // With c+14 we could move sk_sp into lambda to only ref once.
     sk_sp<Plot> plotsp(SkRef(newPlot.get()));
 
-    GrTextureProxy* proxy = fProxies[pageIdx].get();
-    SkASSERT(proxy->isInstantiated());
+    GrTextureProxy* proxy = fViews[pageIdx].asTextureProxy();
+    SkASSERT(proxy && proxy->isInstantiated());
 
     GrDeferredUploadToken lastUploadToken = target->addInlineUpload(
             [plotsp, proxy](GrDeferredTextureUploadWritePixelsFn& writePixels) {
@@ -532,13 +533,15 @@
     int numPlotsY = fTextureHeight/fPlotHeight;
 
     for (uint32_t i = 0; i < this->maxPages(); ++i) {
-        fProxies[i] = proxyProvider->createProxy(
+        sk_sp<GrSurfaceProxy> proxy = proxyProvider->createProxy(
                 fFormat, desc, GrRenderable::kNo, 1, kTopLeft_GrSurfaceOrigin, GrMipMapped::kNo,
                 SkBackingFit::kExact, SkBudgeted::kYes, GrProtected::kNo,
                 GrInternalSurfaceFlags::kNone, GrSurfaceProxy::UseAllocator::kNo);
-        if (!fProxies[i]) {
+        if (!proxy) {
             return false;
         }
+        GrSwizzle swizzle = proxyProvider->caps()->getTextureSwizzle(fFormat, fColorType);
+        fViews[i] = GrSurfaceProxyView(std::move(proxy), kTopLeft_GrSurfaceOrigin, swizzle);
 
         // set up allocated plots
         fPages[i].fPlotArray.reset(new sk_sp<Plot>[ numPlotsX * numPlotsY ]);
@@ -565,7 +568,7 @@
 bool GrDrawOpAtlas::activateNewPage(GrResourceProvider* resourceProvider) {
     SkASSERT(fNumActivePages < this->maxPages());
 
-    if (!fProxies[fNumActivePages]->instantiate(resourceProvider)) {
+    if (!fViews[fNumActivePages].proxy()->instantiate(resourceProvider)) {
         return false;
     }
 
@@ -605,7 +608,7 @@
     }
 
     // remove ref to the backing texture
-    fProxies[lastPageIndex]->deinstantiate();
+    fViews[lastPageIndex].proxy()->deinstantiate();
     --fNumActivePages;
 }
 
diff --git a/src/gpu/GrDrawOpAtlas.h b/src/gpu/GrDrawOpAtlas.h
index 5056d68..4d81ca9 100644
--- a/src/gpu/GrDrawOpAtlas.h
+++ b/src/gpu/GrDrawOpAtlas.h
@@ -125,7 +125,7 @@
                          int width, int height,
                          const void* image, SkIPoint16* loc);
 
-    const sk_sp<GrTextureProxy>* getProxies() const { return fProxies; }
+    const GrSurfaceProxyView* getViews() const { return fViews; }
 
     uint64_t atlasGeneration() const { return fAtlasGeneration; }
 
@@ -412,7 +412,7 @@
         PlotList fPlotList;
     };
     // proxies kept separate to make it easier to pass them up to client
-    sk_sp<GrTextureProxy> fProxies[kMaxMultitexturePages];
+    GrSurfaceProxyView fViews[kMaxMultitexturePages];
     Page fPages[kMaxMultitexturePages];
     uint32_t fMaxPages;
 
diff --git a/src/gpu/GrSurfaceProxyView.h b/src/gpu/GrSurfaceProxyView.h
index bab3b9a..78ea8e9 100644
--- a/src/gpu/GrSurfaceProxyView.h
+++ b/src/gpu/GrSurfaceProxyView.h
@@ -43,6 +43,13 @@
         }
         return fProxy->asTextureProxy();
     }
+    sk_sp<GrTextureProxy> asTextureProxyRef() const {
+        if (!fProxy) {
+            return nullptr;
+        }
+        return sk_ref_sp<GrTextureProxy>(fProxy->asTextureProxy());
+    }
+
     GrRenderTargetProxy* asRenderTargetProxy() const {
         if (!fProxy) {
             return nullptr;
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 5c710cc..6927157 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -121,8 +121,8 @@
 GrBitmapTextGeoProc::GrBitmapTextGeoProc(const GrShaderCaps& caps,
                                          const SkPMColor4f& color,
                                          bool wideColor,
-                                         const sk_sp<GrTextureProxy>* proxies,
-                                         int numActiveProxies,
+                                         const GrSurfaceProxyView* views,
+                                         int numActiveViews,
                                          const GrSamplerState& params, GrMaskFormat format,
                                          const SkMatrix& localMatrix, bool usesW)
         : INHERITED(kGrBitmapTextGeoProc_ClassID)
@@ -130,7 +130,7 @@
         , fLocalMatrix(localMatrix)
         , fUsesW(usesW)
         , fMaskFormat(format) {
-    SkASSERT(numActiveProxies <= kMaxTextures);
+    SkASSERT(numActiveViews <= kMaxTextures);
 
     if (usesW) {
         fInPosition = {"inPosition", kFloat3_GrVertexAttribType, kFloat3_GrSLType};
@@ -148,39 +148,39 @@
                         caps.integerSupport() ? kUShort2_GrSLType : kFloat2_GrSLType};
     this->setVertexAttributes(&fInPosition, 3);
 
-    if (numActiveProxies) {
-        fAtlasDimensions = proxies[0]->dimensions();
+    if (numActiveViews) {
+        fAtlasDimensions = views[0].proxy()->dimensions();
     }
-    for (int i = 0; i < numActiveProxies; ++i) {
-        SkASSERT(proxies[i]);
-        SkASSERT(proxies[i]->dimensions() == fAtlasDimensions);
-        fTextureSamplers[i].reset(params, proxies[i]->backendFormat(),
-                                  proxies[i]->textureSwizzle());
+    for (int i = 0; i < numActiveViews; ++i) {
+        const GrSurfaceProxy* proxy = views[i].proxy();
+        SkASSERT(proxy);
+        SkASSERT(proxy->dimensions() == fAtlasDimensions);
+        fTextureSamplers[i].reset(params, proxy->backendFormat(), views[i].swizzle());
     }
-    this->setTextureSamplerCnt(numActiveProxies);
+    this->setTextureSamplerCnt(numActiveViews);
 }
 
-void GrBitmapTextGeoProc::addNewProxies(const sk_sp<GrTextureProxy>* proxies,
-                                        int numActiveProxies,
-                                        const GrSamplerState& params) {
-    SkASSERT(numActiveProxies <= kMaxTextures);
+void GrBitmapTextGeoProc::addNewViews(const GrSurfaceProxyView* views,
+                                      int numActiveViews,
+                                      const GrSamplerState& params) {
+    SkASSERT(numActiveViews <= kMaxTextures);
     // Just to make sure we don't try to add too many proxies
-    numActiveProxies = SkTMin(numActiveProxies, kMaxTextures);
+    numActiveViews = SkTMin(numActiveViews, kMaxTextures);
 
     if (!fTextureSamplers[0].isInitialized()) {
-        fAtlasDimensions = proxies[0]->dimensions();
+        fAtlasDimensions = views[0].proxy()->dimensions();
     }
 
-    for (int i = 0; i < numActiveProxies; ++i) {
-        SkASSERT(proxies[i]);
-        SkASSERT(proxies[i]->dimensions() == fAtlasDimensions);
+    for (int i = 0; i < numActiveViews; ++i) {
+        const GrSurfaceProxy* proxy = views[i].proxy();
+        SkASSERT(proxy);
+        SkASSERT(proxy->dimensions() == fAtlasDimensions);
 
         if (!fTextureSamplers[i].isInitialized()) {
-            fTextureSamplers[i].reset(params, proxies[i]->backendFormat(),
-                                      proxies[i]->textureSwizzle());
+            fTextureSamplers[i].reset(params, proxy->backendFormat(), views[i].swizzle());
         }
     }
-    this->setTextureSamplerCnt(numActiveProxies);
+    this->setTextureSamplerCnt(numActiveViews);
 }
 
 void GrBitmapTextGeoProc::getGLSLProcessorKey(const GrShaderCaps& caps,
@@ -201,12 +201,7 @@
 GrGeometryProcessor* GrBitmapTextGeoProc::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
                                         : GrProcessorUnitTest::kAlphaTextureIdx;
-    sk_sp<GrTextureProxy> proxies[kMaxTextures] = {
-        d->textureProxy(texIdx),
-        nullptr,
-        nullptr,
-        nullptr
-    };
+    sk_sp<GrTextureProxy> proxy = d->textureProxy(texIdx);
 
     GrSamplerState::WrapMode wrapModes[2];
     GrTest::TestWrapModes(d->fRandom, wrapModes);
@@ -226,11 +221,14 @@
             format = kARGB_GrMaskFormat;
             break;
     }
+    GrSurfaceOrigin origin = proxy->origin();
+    const GrSwizzle& swizzle = proxy->textureSwizzle();
+    GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
 
     return GrBitmapTextGeoProc::Make(d->allocator(), *d->caps()->shaderCaps(),
                                      SkPMColor4f::FromBytes_RGBA(GrRandomColor(d->fRandom)),
                                      d->fRandom->nextBool(),
-                                     proxies, 1, samplerState, format,
+                                     &view, 1, samplerState, format,
                                      GrTest::TestMatrix(d->fRandom), d->fRandom->nextBool());
 }
 #endif
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.h b/src/gpu/effects/GrBitmapTextGeoProc.h
index c6912d3..6f3716e 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.h
+++ b/src/gpu/effects/GrBitmapTextGeoProc.h
@@ -14,6 +14,7 @@
 
 class GrGLBitmapTextGeoProc;
 class GrInvariantOutput;
+class GrSurfaceProxyView;
 
 /**
  * The output color of this effect is a modulation of the input color and a sample from a texture.
@@ -27,11 +28,11 @@
     static GrGeometryProcessor* Make(SkArenaAlloc* arena,
                                      const GrShaderCaps& caps,
                                      const SkPMColor4f& color, bool wideColor,
-                                     const sk_sp<GrTextureProxy>* proxies,
-                                     int numActiveProxies,
+                                     const GrSurfaceProxyView* views,
+                                     int numActiveViews,
                                      const GrSamplerState& p, GrMaskFormat format,
                                      const SkMatrix& localMatrix, bool usesW) {
-        return arena->make<GrBitmapTextGeoProc>(caps, color, wideColor, proxies, numActiveProxies,
+        return arena->make<GrBitmapTextGeoProc>(caps, color, wideColor, views, numActiveViews,
                                                 p, format, localMatrix, usesW);
     }
 
@@ -49,7 +50,7 @@
     bool usesW() const { return fUsesW; }
     const SkISize& atlasDimensions() const { return fAtlasDimensions; }
 
-    void addNewProxies(const sk_sp<GrTextureProxy>*, int numActiveProxies, const GrSamplerState&);
+    void addNewViews(const GrSurfaceProxyView*, int numActiveViews, const GrSamplerState&);
 
     void getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override;
 
@@ -59,7 +60,7 @@
     friend class ::SkArenaAlloc; // for access to ctor
 
     GrBitmapTextGeoProc(const GrShaderCaps&, const SkPMColor4f&, bool wideColor,
-                        const sk_sp<GrTextureProxy>* proxies, int numProxies,
+                        const GrSurfaceProxyView* views, int numViews,
                         const GrSamplerState& params, GrMaskFormat format,
                         const SkMatrix& localMatrix, bool usesW);
 
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 1122d0e..2ecbdce 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -209,8 +209,8 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 GrDistanceFieldA8TextGeoProc::GrDistanceFieldA8TextGeoProc(const GrShaderCaps& caps,
-                                                           const sk_sp<GrTextureProxy>* proxies,
-                                                           int numProxies,
+                                                           const GrSurfaceProxyView* views,
+                                                           int numViews,
                                                            const GrSamplerState& params,
 #ifdef SK_GAMMA_APPLY_TO_A8
                                                            float distanceAdjust,
@@ -224,7 +224,7 @@
         , fDistanceAdjust(distanceAdjust)
 #endif
 {
-    SkASSERT(numProxies <= kMaxTextures);
+    SkASSERT(numViews <= kMaxTextures);
     SkASSERT(!(flags & ~kNonLCD_DistanceFieldEffectMask));
 
     if (flags & kPerspective_DistanceFieldEffectFlag) {
@@ -237,38 +237,38 @@
                         caps.integerSupport() ? kUShort2_GrSLType : kFloat2_GrSLType};
     this->setVertexAttributes(&fInPosition, 3);
 
-    if (numProxies) {
-        fAtlasDimensions = proxies[0]->dimensions();
+    if (numViews) {
+        fAtlasDimensions = views[0].proxy()->dimensions();
     }
-    for (int i = 0; i < numProxies; ++i) {
-        SkASSERT(proxies[i]);
-        SkASSERT(proxies[i]->dimensions() == fAtlasDimensions);
-        fTextureSamplers[i].reset(params, proxies[i]->backendFormat(),
-                                  proxies[i]->textureSwizzle());
+    for (int i = 0; i < numViews; ++i) {
+        const GrSurfaceProxy* proxy = views[i].proxy();
+        SkASSERT(proxy);
+        SkASSERT(proxy->dimensions() == fAtlasDimensions);
+        fTextureSamplers[i].reset(params, proxy->backendFormat(), views[i].swizzle());
     }
-    this->setTextureSamplerCnt(numProxies);
+    this->setTextureSamplerCnt(numViews);
 }
 
-void GrDistanceFieldA8TextGeoProc::addNewProxies(const sk_sp<GrTextureProxy>* proxies,
-                                                 int numProxies,
-                                                 const GrSamplerState& params) {
-    SkASSERT(numProxies <= kMaxTextures);
+void GrDistanceFieldA8TextGeoProc::addNewViews(const GrSurfaceProxyView* views,
+                                               int numViews,
+                                               const GrSamplerState& params) {
+    SkASSERT(numViews <= kMaxTextures);
     // Just to make sure we don't try to add too many proxies
-    numProxies = SkTMin(numProxies, kMaxTextures);
+    numViews = SkTMin(numViews, kMaxTextures);
 
     if (!fTextureSamplers[0].isInitialized()) {
-        fAtlasDimensions = proxies[0]->dimensions();
+        fAtlasDimensions = views[0].proxy()->dimensions();
     }
 
-    for (int i = 0; i < numProxies; ++i) {
-        SkASSERT(proxies[i]);
-        SkASSERT(proxies[i]->dimensions() == fAtlasDimensions);
+    for (int i = 0; i < numViews; ++i) {
+        const GrSurfaceProxy* proxy = views[i].proxy();
+        SkASSERT(proxy);
+        SkASSERT(proxy->dimensions() == fAtlasDimensions);
         if (!fTextureSamplers[i].isInitialized()) {
-            fTextureSamplers[i].reset(params, proxies[i]->backendFormat(),
-                                      proxies[i]->textureSwizzle());
+            fTextureSamplers[i].reset(params, proxy->backendFormat(), views[i].swizzle());
         }
     }
-    this->setTextureSamplerCnt(numProxies);
+    this->setTextureSamplerCnt(numViews);
 }
 
 void GrDistanceFieldA8TextGeoProc::getGLSLProcessorKey(const GrShaderCaps& caps,
@@ -289,12 +289,7 @@
 GrGeometryProcessor* GrDistanceFieldA8TextGeoProc::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
                                         : GrProcessorUnitTest::kAlphaTextureIdx;
-    sk_sp<GrTextureProxy> proxies[kMaxTextures] = {
-        d->textureProxy(texIdx),
-        nullptr,
-        nullptr,
-        nullptr
-    };
+    sk_sp<GrTextureProxy> proxy = d->textureProxy(texIdx);
 
     GrSamplerState::WrapMode wrapModes[2];
     GrTest::TestWrapModes(d->fRandom, wrapModes);
@@ -311,8 +306,12 @@
 #ifdef SK_GAMMA_APPLY_TO_A8
     float lum = d->fRandom->nextF();
 #endif
+    GrSurfaceOrigin origin = proxy->origin();
+    const GrSwizzle& swizzle = proxy->textureSwizzle();
+    GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
+
     return GrDistanceFieldA8TextGeoProc::Make(d->allocator(), *d->caps()->shaderCaps(),
-                                              proxies, 1,
+                                              &view, 1,
                                               samplerState,
 #ifdef SK_GAMMA_APPLY_TO_A8
                                               lum,
@@ -516,14 +515,14 @@
 GrDistanceFieldPathGeoProc::GrDistanceFieldPathGeoProc(const GrShaderCaps& caps,
                                                        const SkMatrix& matrix,
                                                        bool wideColor,
-                                                       const sk_sp<GrTextureProxy>* proxies,
-                                                       int numProxies,
+                                                       const GrSurfaceProxyView* views,
+                                                       int numViews,
                                                        const GrSamplerState& params,
                                                        uint32_t flags)
         : INHERITED(kGrDistanceFieldPathGeoProc_ClassID)
         , fMatrix(matrix)
         , fFlags(flags & kNonLCD_DistanceFieldEffectMask) {
-    SkASSERT(numProxies <= kMaxTextures);
+    SkASSERT(numViews <= kMaxTextures);
     SkASSERT(!(flags & ~kNonLCD_DistanceFieldEffectMask));
 
     fInPosition = {"inPosition", kFloat2_GrVertexAttribType, kFloat2_GrSLType};
@@ -532,40 +531,39 @@
                         caps.integerSupport() ? kUShort2_GrSLType : kFloat2_GrSLType};
     this->setVertexAttributes(&fInPosition, 3);
 
-    if (numProxies) {
-        fAtlasDimensions = proxies[0]->dimensions();
+    if (numViews) {
+        fAtlasDimensions = views[0].proxy()->dimensions();
     }
 
-    for (int i = 0; i < numProxies; ++i) {
-        SkASSERT(proxies[i]);
-        SkASSERT(proxies[i]->dimensions() == fAtlasDimensions);
-        fTextureSamplers[i].reset(params, proxies[i]->backendFormat(),
-                                  proxies[i]->textureSwizzle());
+    for (int i = 0; i < numViews; ++i) {
+        const GrSurfaceProxy* proxy = views[i].proxy();
+        SkASSERT(proxy);
+        SkASSERT(proxy->dimensions() == fAtlasDimensions);
+        fTextureSamplers[i].reset(params, proxy->backendFormat(), views[i].swizzle());
     }
-    this->setTextureSamplerCnt(numProxies);
+    this->setTextureSamplerCnt(numViews);
 }
 
-void GrDistanceFieldPathGeoProc::addNewProxies(const sk_sp<GrTextureProxy>* proxies,
-                                               int numProxies,
-                                               const GrSamplerState& params) {
-    SkASSERT(numProxies <= kMaxTextures);
+void GrDistanceFieldPathGeoProc::addNewViews(const GrSurfaceProxyView* views,
+                                             int numViews,
+                                             const GrSamplerState& params) {
+    SkASSERT(numViews <= kMaxTextures);
     // Just to make sure we don't try to add too many proxies
-    numProxies = SkTMin(numProxies, kMaxTextures);
+    numViews = SkTMin(numViews, kMaxTextures);
 
     if (!fTextureSamplers[0].isInitialized()) {
-        fAtlasDimensions = proxies[0]->dimensions();
+        fAtlasDimensions = views[0].proxy()->dimensions();
     }
 
-    for (int i = 0; i < numProxies; ++i) {
-        SkASSERT(proxies[i]);
-        SkASSERT(proxies[i]->dimensions() == fAtlasDimensions);
-
+    for (int i = 0; i < numViews; ++i) {
+        const GrSurfaceProxy* proxy = views[i].proxy();
+        SkASSERT(proxy);
+        SkASSERT(proxy->dimensions() == fAtlasDimensions);
         if (!fTextureSamplers[i].isInitialized()) {
-            fTextureSamplers[i].reset(params, proxies[i]->backendFormat(),
-                                      proxies[i]->textureSwizzle());
+            fTextureSamplers[i].reset(params, proxy->backendFormat(), views[i].swizzle());
         }
     }
-    this->setTextureSamplerCnt(numProxies);
+    this->setTextureSamplerCnt(numViews);
 }
 
 void GrDistanceFieldPathGeoProc::getGLSLProcessorKey(const GrShaderCaps& caps,
@@ -586,12 +584,7 @@
 GrGeometryProcessor* GrDistanceFieldPathGeoProc::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
                                         : GrProcessorUnitTest::kAlphaTextureIdx;
-    sk_sp<GrTextureProxy> proxies[kMaxTextures] = {
-        d->textureProxy(texIdx),
-        nullptr,
-        nullptr,
-        nullptr
-    };
+    sk_sp<GrTextureProxy> proxy = d->textureProxy(texIdx);
 
     GrSamplerState::WrapMode wrapModes[2];
     GrTest::TestWrapModes(d->fRandom, wrapModes);
@@ -604,11 +597,14 @@
     if (flags & kSimilarity_DistanceFieldEffectFlag) {
         flags |= d->fRandom->nextBool() ? kScaleOnly_DistanceFieldEffectFlag : 0;
     }
+    GrSurfaceOrigin origin = proxy->origin();
+    const GrSwizzle& swizzle = proxy->textureSwizzle();
+    GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
 
     return GrDistanceFieldPathGeoProc::Make(d->allocator(), *d->caps()->shaderCaps(),
                                             GrTest::TestMatrix(d->fRandom),
                                             d->fRandom->nextBool(),
-                                            proxies, 1,
+                                            &view, 1,
                                             samplerState,
                                             flags);
 }
@@ -837,8 +833,8 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 GrDistanceFieldLCDTextGeoProc::GrDistanceFieldLCDTextGeoProc(const GrShaderCaps& caps,
-                                                             const sk_sp<GrTextureProxy>* proxies,
-                                                             int numProxies,
+                                                             const GrSurfaceProxyView* views,
+                                                             int numViews,
                                                              const GrSamplerState& params,
                                                              DistanceAdjust distanceAdjust,
                                                              uint32_t flags,
@@ -847,7 +843,7 @@
         , fLocalMatrix(localMatrix)
         , fDistanceAdjust(distanceAdjust)
         , fFlags(flags & kLCD_DistanceFieldEffectMask) {
-    SkASSERT(numProxies <= kMaxTextures);
+    SkASSERT(numViews <= kMaxTextures);
     SkASSERT(!(flags & ~kLCD_DistanceFieldEffectMask) && (flags & kUseLCD_DistanceFieldEffectFlag));
 
     if (fFlags & kPerspective_DistanceFieldEffectFlag) {
@@ -860,40 +856,39 @@
                         caps.integerSupport() ? kUShort2_GrSLType : kFloat2_GrSLType};
     this->setVertexAttributes(&fInPosition, 3);
 
-    if (numProxies) {
-        fAtlasDimensions = proxies[0]->dimensions();
+    if (numViews) {
+        fAtlasDimensions = views[0].proxy()->dimensions();
     }
 
-    for (int i = 0; i < numProxies; ++i) {
-        SkASSERT(proxies[i]);
-        SkASSERT(proxies[i]->dimensions() == fAtlasDimensions);
-        fTextureSamplers[i].reset(params, proxies[i]->backendFormat(),
-                                  proxies[i]->textureSwizzle());
+    for (int i = 0; i < numViews; ++i) {
+        const GrSurfaceProxy* proxy = views[i].proxy();
+        SkASSERT(proxy);
+        SkASSERT(proxy->dimensions() == fAtlasDimensions);
+        fTextureSamplers[i].reset(params, proxy->backendFormat(), views[i].swizzle());
     }
-    this->setTextureSamplerCnt(numProxies);
+    this->setTextureSamplerCnt(numViews);
 }
 
-void GrDistanceFieldLCDTextGeoProc::addNewProxies(const sk_sp<GrTextureProxy>* proxies,
-                                                  int numProxies,
-                                                  const GrSamplerState& params) {
-    SkASSERT(numProxies <= kMaxTextures);
+void GrDistanceFieldLCDTextGeoProc::addNewViews(const GrSurfaceProxyView* views,
+                                                int numViews,
+                                                const GrSamplerState& params) {
+    SkASSERT(numViews <= kMaxTextures);
     // Just to make sure we don't try to add too many proxies
-    numProxies = SkTMin(numProxies, kMaxTextures);
+    numViews = SkTMin(numViews, kMaxTextures);
 
     if (!fTextureSamplers[0].isInitialized()) {
-        fAtlasDimensions = proxies[0]->dimensions();
+        fAtlasDimensions = views[0].proxy()->dimensions();
     }
 
-    for (int i = 0; i < numProxies; ++i) {
-        SkASSERT(proxies[i]);
-        SkASSERT(proxies[i]->dimensions() == fAtlasDimensions);
-
+    for (int i = 0; i < numViews; ++i) {
+        const GrSurfaceProxy* proxy = views[i].proxy();
+        SkASSERT(proxy);
+        SkASSERT(proxy->dimensions() == fAtlasDimensions);
         if (!fTextureSamplers[i].isInitialized()) {
-            fTextureSamplers[i].reset(params, proxies[i]->backendFormat(),
-                                      proxies[i]->textureSwizzle());
+            fTextureSamplers[i].reset(params, proxy->backendFormat(), views[i].swizzle());
         }
     }
-    this->setTextureSamplerCnt(numProxies);
+    this->setTextureSamplerCnt(numViews);
 }
 
 void GrDistanceFieldLCDTextGeoProc::getGLSLProcessorKey(const GrShaderCaps& caps,
@@ -913,12 +908,7 @@
 GrGeometryProcessor* GrDistanceFieldLCDTextGeoProc::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
                                           GrProcessorUnitTest::kAlphaTextureIdx;
-    sk_sp<GrTextureProxy> proxies[kMaxTextures] = {
-        d->textureProxy(texIdx),
-        nullptr,
-        nullptr,
-        nullptr
-    };
+    sk_sp<GrTextureProxy> proxy = d->textureProxy(texIdx);
 
     GrSamplerState::WrapMode wrapModes[2];
     GrTest::TestWrapModes(d->fRandom, wrapModes);
@@ -933,7 +923,12 @@
     }
     flags |= d->fRandom->nextBool() ? kBGR_DistanceFieldEffectFlag : 0;
     SkMatrix localMatrix = GrTest::TestMatrix(d->fRandom);
-    return GrDistanceFieldLCDTextGeoProc::Make(d->allocator(), *d->caps()->shaderCaps(), proxies,
+
+    GrSurfaceOrigin origin = proxy->origin();
+    const GrSwizzle& swizzle = proxy->textureSwizzle();
+    GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
+
+    return GrDistanceFieldLCDTextGeoProc::Make(d->allocator(), *d->caps()->shaderCaps(), &view,
                                                1, samplerState, wa, flags, localMatrix);
 }
 #endif
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.h b/src/gpu/effects/GrDistanceFieldGeoProc.h
index 95e3a11..233ec1a 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.h
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.h
@@ -60,22 +60,22 @@
 #ifdef SK_GAMMA_APPLY_TO_A8
     static GrGeometryProcessor* Make(SkArenaAlloc* arena,
                                      const GrShaderCaps& caps,
-                                     const sk_sp<GrTextureProxy>* proxies,
-                                     int numActiveProxies,
+                                     const GrSurfaceProxyView* views,
+                                     int numActiveViews,
                                      const GrSamplerState& params, float lum, uint32_t flags,
                                      const SkMatrix& localMatrixIfUsesLocalCoords) {
         return arena->make<GrDistanceFieldA8TextGeoProc>(
-                caps, proxies, numActiveProxies, params, lum, flags, localMatrixIfUsesLocalCoords);
+                caps, views, numActiveViews, params, lum, flags, localMatrixIfUsesLocalCoords);
     }
 #else
     static GrGeometryProcessor* Make(SkArenaAlloc* arena,
                                      const GrShaderCaps& caps,
-                                     const sk_sp<GrTextureProxy>* proxies,
-                                     int numActiveProxies,
+                                     const GrSurfaceProxyView* views,
+                                     int numActiveViews,
                                      const GrSamplerState& params, uint32_t flags,
                                      const SkMatrix& localMatrixIfUsesLocalCoords) {
         return arena->make<GrDistanceFieldA8TextGeoProc>(
-                caps, proxies, numActiveProxies, params, flags, localMatrixIfUsesLocalCoords);
+                caps, views, numActiveViews, params, flags, localMatrixIfUsesLocalCoords);
     }
 #endif
 
@@ -93,7 +93,7 @@
     uint32_t getFlags() const { return fFlags; }
     const SkISize& atlasDimensions() const { return fAtlasDimensions; }
 
-    void addNewProxies(const sk_sp<GrTextureProxy>* proxies, int numProxies, const GrSamplerState&);
+    void addNewViews(const GrSurfaceProxyView* views, int numViews, const GrSamplerState&);
 
     void getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override;
 
@@ -103,8 +103,8 @@
     friend class ::SkArenaAlloc; // for access to ctor
 
     GrDistanceFieldA8TextGeoProc(const GrShaderCaps& caps,
-                                 const sk_sp<GrTextureProxy>* proxies,
-                                 int numActiveProxies,
+                                 const GrSurfaceProxyView* views,
+                                 int numActiveViews,
                                  const GrSamplerState& params,
 #ifdef SK_GAMMA_APPLY_TO_A8
                                  float distanceAdjust,
@@ -144,11 +144,11 @@
                                      const GrShaderCaps& caps,
                                      const SkMatrix& matrix,
                                      bool wideColor,
-                                     const sk_sp<GrTextureProxy>* proxies,
-                                     int numActiveProxies,
+                                     const GrSurfaceProxyView* views,
+                                     int numActiveViews,
                                      const GrSamplerState& params, uint32_t flags) {
-        return arena->make<GrDistanceFieldPathGeoProc>(caps, matrix, wideColor, proxies,
-                                                       numActiveProxies, params, flags);
+        return arena->make<GrDistanceFieldPathGeoProc>(caps, matrix, wideColor, views,
+                                                       numActiveViews, params, flags);
     }
 
     ~GrDistanceFieldPathGeoProc() override {}
@@ -162,7 +162,7 @@
     uint32_t getFlags() const { return fFlags; }
     const SkISize& atlasDimensions() const { return fAtlasDimensions; }
 
-    void addNewProxies(const sk_sp<GrTextureProxy>*, int numActiveProxies, const GrSamplerState&);
+    void addNewViews(const GrSurfaceProxyView*, int numActiveViews, const GrSamplerState&);
 
     void getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override;
 
@@ -174,8 +174,8 @@
     GrDistanceFieldPathGeoProc(const GrShaderCaps& caps,
                                const SkMatrix& matrix,
                                bool wideColor,
-                               const sk_sp<GrTextureProxy>* proxies,
-                               int numActiveProxies,
+                               const GrSurfaceProxyView* views,
+                               int numActiveViews,
                                const GrSamplerState&, uint32_t flags);
 
     const TextureSampler& onTextureSampler(int i) const override { return fTextureSamplers[i]; }
@@ -220,13 +220,13 @@
 
     static GrGeometryProcessor* Make(SkArenaAlloc* arena,
                                      const GrShaderCaps& caps,
-                                     const sk_sp<GrTextureProxy>* proxies,
-                                     int numActiveProxies,
+                                     const GrSurfaceProxyView* views,
+                                     int numActiveViews,
                                      const GrSamplerState& params,
                                      DistanceAdjust distanceAdjust,
                                      uint32_t flags,
                                      const SkMatrix& localMatrixIfUsesLocalCoords) {
-        return arena->make<GrDistanceFieldLCDTextGeoProc>(caps, proxies, numActiveProxies, params,
+        return arena->make<GrDistanceFieldLCDTextGeoProc>(caps, views, numActiveViews, params,
                                                           distanceAdjust, flags,
                                                           localMatrixIfUsesLocalCoords);
     }
@@ -243,7 +243,7 @@
     const SkMatrix& localMatrix() const { return fLocalMatrix; }
     const SkISize& atlasDimensions() const { return fAtlasDimensions; }
 
-    void addNewProxies(const sk_sp<GrTextureProxy>*, int numActiveProxies, const GrSamplerState&);
+    void addNewViews(const GrSurfaceProxyView*, int numActiveViews, const GrSamplerState&);
 
     void getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override;
 
@@ -252,8 +252,8 @@
 private:
     friend class ::SkArenaAlloc; // for access to ctor
 
-    GrDistanceFieldLCDTextGeoProc(const GrShaderCaps& caps, const sk_sp<GrTextureProxy>* proxies,
-                                  int numActiveProxies, const GrSamplerState& params,
+    GrDistanceFieldLCDTextGeoProc(const GrShaderCaps& caps, const GrSurfaceProxyView* views,
+                                  int numActiveViews, const GrSamplerState& params,
                                   DistanceAdjust wa, uint32_t flags, const SkMatrix& localMatrix);
 
     const TextureSampler& onTextureSampler(int i) const override { return fTextureSamplers[i]; }
diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp
index a493fb6..0a73668 100644
--- a/src/gpu/ops/GrAtlasTextOp.cpp
+++ b/src/gpu/ops/GrAtlasTextOp.cpp
@@ -290,24 +290,24 @@
 
     GrMaskFormat maskFormat = this->maskFormat();
 
-    unsigned int numActiveProxies;
-    const sk_sp<GrTextureProxy>* proxies = atlasManager->getProxies(maskFormat, &numActiveProxies);
-    if (!proxies) {
+    unsigned int numActiveViews;
+    const GrSurfaceProxyView* views = atlasManager->getViews(maskFormat, &numActiveViews);
+    if (!views) {
         SkDebugf("Could not allocate backing texture for atlas\n");
         return;
     }
-    SkASSERT(proxies[0]);
+    SkASSERT(views[0].proxy());
 
     static constexpr int kMaxTextures = GrBitmapTextGeoProc::kMaxTextures;
     GR_STATIC_ASSERT(GrDistanceFieldA8TextGeoProc::kMaxTextures == kMaxTextures);
     GR_STATIC_ASSERT(GrDistanceFieldLCDTextGeoProc::kMaxTextures == kMaxTextures);
 
     auto fixedDynamicState = target->makeFixedDynamicState(kMaxTextures);
-    for (unsigned i = 0; i < numActiveProxies; ++i) {
-        fixedDynamicState->fPrimitiveProcessorTextures[i] = proxies[i].get();
+    for (unsigned i = 0; i < numActiveViews; ++i) {
+        fixedDynamicState->fPrimitiveProcessorTextures[i] = views[i].proxy();
         // This op does not know its atlas proxies when it is added to a GrOpsTasks, so the proxies
         // don't get added during the visitProxies call. Thus we add them here.
-        target->sampledProxyArray()->push_back(proxies[i].get());
+        target->sampledProxyArray()->push_back(views[i].proxy());
     }
 
     FlushInfo flushInfo;
@@ -317,12 +317,12 @@
     if (this->usesDistanceFields()) {
         flushInfo.fGeometryProcessor = this->setupDfProcessor(target->allocator(),
                                                               *target->caps().shaderCaps(),
-                                                              proxies, numActiveProxies);
+                                                              views, numActiveViews);
     } else {
         GrSamplerState samplerState = fNeedsGlyphTransform ? GrSamplerState::ClampBilerp()
                                                            : GrSamplerState::ClampNearest();
         flushInfo.fGeometryProcessor = GrBitmapTextGeoProc::Make(target->allocator(),
-            *target->caps().shaderCaps(), this->color(), false, proxies, numActiveProxies,
+            *target->caps().shaderCaps(), this->color(), false, views, numActiveViews,
             samplerState, maskFormat, localMatrix, vmPerspective);
     }
 
@@ -411,34 +411,34 @@
     GrGeometryProcessor* gp = flushInfo->fGeometryProcessor;
     GrMaskFormat maskFormat = this->maskFormat();
 
-    unsigned int numActiveProxies;
-    const sk_sp<GrTextureProxy>* proxies = atlasManager->getProxies(maskFormat, &numActiveProxies);
-    SkASSERT(proxies);
+    unsigned int numActiveViews;
+    const GrSurfaceProxyView* views = atlasManager->getViews(maskFormat, &numActiveViews);
+    SkASSERT(views);
     // Something has gone terribly wrong, bail
-    if (!proxies || 0 == numActiveProxies) {
+    if (!views || 0 == numActiveViews) {
         return;
     }
-    if (gp->numTextureSamplers() != (int) numActiveProxies) {
+    if (gp->numTextureSamplers() != (int) numActiveViews) {
         // During preparation the number of atlas pages has increased.
         // Update the proxies used in the GP to match.
-        for (unsigned i = gp->numTextureSamplers(); i < numActiveProxies; ++i) {
-            flushInfo->fFixedDynamicState->fPrimitiveProcessorTextures[i] = proxies[i].get();
+        for (unsigned i = gp->numTextureSamplers(); i < numActiveViews; ++i) {
+            flushInfo->fFixedDynamicState->fPrimitiveProcessorTextures[i] = views[i].proxy();
             // This op does not know its atlas proxies when it is added to a GrOpsTasks, so the
             // proxies don't get added during the visitProxies call. Thus we add them here.
-            target->sampledProxyArray()->push_back(proxies[i].get());
+            target->sampledProxyArray()->push_back(views[i].proxy());
         }
         if (this->usesDistanceFields()) {
             if (this->isLCD()) {
-                reinterpret_cast<GrDistanceFieldLCDTextGeoProc*>(gp)->addNewProxies(
-                    proxies, numActiveProxies, GrSamplerState::ClampBilerp());
+                reinterpret_cast<GrDistanceFieldLCDTextGeoProc*>(gp)->addNewViews(
+                    views, numActiveViews, GrSamplerState::ClampBilerp());
             } else {
-                reinterpret_cast<GrDistanceFieldA8TextGeoProc*>(gp)->addNewProxies(
-                    proxies, numActiveProxies, GrSamplerState::ClampBilerp());
+                reinterpret_cast<GrDistanceFieldA8TextGeoProc*>(gp)->addNewViews(
+                    views, numActiveViews, GrSamplerState::ClampBilerp());
             }
         } else {
             GrSamplerState samplerState = fNeedsGlyphTransform ? GrSamplerState::ClampBilerp()
                                                                : GrSamplerState::ClampNearest();
-            reinterpret_cast<GrBitmapTextGeoProc*>(gp)->addNewProxies(proxies, numActiveProxies,
+            reinterpret_cast<GrBitmapTextGeoProc*>(gp)->addNewViews(views, numActiveViews,
                                                                       samplerState);
         }
     }
@@ -534,8 +534,8 @@
 // (see comments in GrTextContext::ComputeCanonicalColor)
 GrGeometryProcessor* GrAtlasTextOp::setupDfProcessor(SkArenaAlloc* arena,
                                                      const GrShaderCaps& caps,
-                                                     const sk_sp<GrTextureProxy>* proxies,
-                                                     unsigned int numActiveProxies) const {
+                                                     const GrSurfaceProxyView* views,
+                                                     unsigned int numActiveViews) const {
     bool isLCD = this->isLCD();
 
     SkMatrix localMatrix = SkMatrix::I();
@@ -559,7 +559,7 @@
         GrDistanceFieldLCDTextGeoProc::DistanceAdjust widthAdjust =
                 GrDistanceFieldLCDTextGeoProc::DistanceAdjust::Make(
                         redCorrection, greenCorrection, blueCorrection);
-        return GrDistanceFieldLCDTextGeoProc::Make(arena, caps, proxies, numActiveProxies,
+        return GrDistanceFieldLCDTextGeoProc::Make(arena, caps, views, numActiveViews,
                                                    GrSamplerState::ClampBilerp(), widthAdjust,
                                                    fDFGPFlags, localMatrix);
     } else {
@@ -571,11 +571,11 @@
             correction = fDistanceAdjustTable->getAdjustment(lum >> kDistanceAdjustLumShift,
                                                              fUseGammaCorrectDistanceTable);
         }
-        return GrDistanceFieldA8TextGeoProc::Make(arena, caps, proxies, numActiveProxies,
+        return GrDistanceFieldA8TextGeoProc::Make(arena, caps, views, numActiveViews,
                                                   GrSamplerState::ClampBilerp(),
                                                   correction, fDFGPFlags, localMatrix);
 #else
-        return GrDistanceFieldA8TextGeoProc::Make(arena, caps, proxies, numActiveProxies,
+        return GrDistanceFieldA8TextGeoProc::Make(arena, caps, views, numActiveViews,
                                                   GrSamplerState::ClampBilerp(),
                                                   fDFGPFlags, localMatrix);
 #endif
diff --git a/src/gpu/ops/GrAtlasTextOp.h b/src/gpu/ops/GrAtlasTextOp.h
index 027ea72..72e6202 100644
--- a/src/gpu/ops/GrAtlasTextOp.h
+++ b/src/gpu/ops/GrAtlasTextOp.h
@@ -154,8 +154,8 @@
 
     GrGeometryProcessor* setupDfProcessor(SkArenaAlloc* arena,
                                           const GrShaderCaps& caps,
-                                          const sk_sp<GrTextureProxy>* proxies,
-                                          unsigned int numActiveProxies) const;
+                                          const GrSurfaceProxyView* views,
+                                          unsigned int numActiveViews) const;
 
     SkAutoSTMalloc<kMinGeometryAllocated, Geometry> fGeoData;
     int fGeoDataAllocSize;
diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp
index 96b40c4..1259a93 100644
--- a/src/gpu/ops/GrSmallPathRenderer.cpp
+++ b/src/gpu/ops/GrSmallPathRenderer.cpp
@@ -276,10 +276,10 @@
     void visitProxies(const VisitProxyFunc& func) const override {
         fHelper.visitProxies(func);
 
-        const sk_sp<GrTextureProxy>* proxies = fAtlas->getProxies();
+        const GrSurfaceProxyView* views = fAtlas->getViews();
         for (uint32_t i = 0; i < fAtlas->numActivePages(); ++i) {
-            SkASSERT(proxies[i]);
-            func(proxies[i].get(), GrMipMapped::kNo);
+            SkASSERT(views[i].proxy());
+            func(views[i].proxy(), GrMipMapped::kNo);
         }
     }
 
@@ -324,12 +324,12 @@
         FlushInfo flushInfo;
         flushInfo.fFixedDynamicState = target->makeFixedDynamicState(kMaxTextures);
         int numActiveProxies = fAtlas->numActivePages();
-        const auto proxies = fAtlas->getProxies();
+        const auto views = fAtlas->getViews();
         for (int i = 0; i < numActiveProxies; ++i) {
             // This op does not know its atlas proxies when it is added to a GrOpsTasks, so the
             // proxies don't get added during the visitProxies call. Thus we add them here.
-            flushInfo.fFixedDynamicState->fPrimitiveProcessorTextures[i] = proxies[i].get();
-            target->sampledProxyArray()->push_back(proxies[i].get());
+            flushInfo.fFixedDynamicState->fPrimitiveProcessorTextures[i] = views[i].proxy();
+            target->sampledProxyArray()->push_back(views[i].proxy());
         }
 
         // Setup GrGeometryProcessor
@@ -354,7 +354,7 @@
                 matrix = &SkMatrix::I();
             }
             flushInfo.fGeometryProcessor = GrDistanceFieldPathGeoProc::Make(target->allocator(),
-                    *target->caps().shaderCaps(), *matrix, fWideColor, fAtlas->getProxies(),
+                    *target->caps().shaderCaps(), *matrix, fWideColor, fAtlas->getViews(),
                     fAtlas->numActivePages(), GrSamplerState::ClampBilerp(), flags);
         } else {
             SkMatrix invert;
@@ -365,7 +365,7 @@
             }
 
             flushInfo.fGeometryProcessor = GrBitmapTextGeoProc::Make(target->allocator(),
-                    *target->caps().shaderCaps(), this->color(), fWideColor, fAtlas->getProxies(),
+                    *target->caps().shaderCaps(), this->color(), fWideColor, fAtlas->getViews(),
                     fAtlas->numActivePages(), GrSamplerState::ClampNearest(), kA8_GrMaskFormat,
                     invert, false);
         }
@@ -776,22 +776,22 @@
     void flush(GrMeshDrawOp::Target* target, FlushInfo* flushInfo) const {
         GrGeometryProcessor* gp = flushInfo->fGeometryProcessor;
         int numAtlasTextures = SkToInt(fAtlas->numActivePages());
-        auto proxies = fAtlas->getProxies();
+        const auto views = fAtlas->getViews();
         if (gp->numTextureSamplers() != numAtlasTextures) {
             for (int i = gp->numTextureSamplers(); i < numAtlasTextures; ++i) {
-                flushInfo->fFixedDynamicState->fPrimitiveProcessorTextures[i] = proxies[i].get();
+                flushInfo->fFixedDynamicState->fPrimitiveProcessorTextures[i] = views[i].proxy();
                 // This op does not know its atlas proxies when it is added to a GrOpsTasks, so the
                 // proxies don't get added during the visitProxies call. Thus we add them here.
-                target->sampledProxyArray()->push_back(proxies[i].get());
+                target->sampledProxyArray()->push_back(views[i].proxy());
             }
             // During preparation the number of atlas pages has increased.
             // Update the proxies used in the GP to match.
             if (fUsesDistanceField) {
-                reinterpret_cast<GrDistanceFieldPathGeoProc*>(gp)->addNewProxies(
-                    fAtlas->getProxies(), fAtlas->numActivePages(), GrSamplerState::ClampBilerp());
+                reinterpret_cast<GrDistanceFieldPathGeoProc*>(gp)->addNewViews(
+                    fAtlas->getViews(), fAtlas->numActivePages(), GrSamplerState::ClampBilerp());
             } else {
-                reinterpret_cast<GrBitmapTextGeoProc*>(gp)->addNewProxies(
-                    fAtlas->getProxies(), fAtlas->numActivePages(), GrSamplerState::ClampNearest());
+                reinterpret_cast<GrBitmapTextGeoProc*>(gp)->addNewViews(
+                    fAtlas->getViews(), fAtlas->numActivePages(), GrSamplerState::ClampNearest());
             }
         }
 
diff --git a/src/gpu/text/GrAtlasManager.cpp b/src/gpu/text/GrAtlasManager.cpp
index 89b488d..ab47187 100644
--- a/src/gpu/text/GrAtlasManager.cpp
+++ b/src/gpu/text/GrAtlasManager.cpp
@@ -131,9 +131,9 @@
     static int gDumpCount = 0;
     for (int i = 0; i < kMaskFormatCount; ++i) {
         if (fAtlases[i]) {
-            const sk_sp<GrTextureProxy>* proxies = fAtlases[i]->getProxies();
+            const GrSurfaceProxyView* views = fAtlases[i]->getViews();
             for (uint32_t pageIdx = 0; pageIdx < fAtlases[i]->numActivePages(); ++pageIdx) {
-                SkASSERT(proxies[pageIdx]);
+                SkASSERT(views[pageIdx].proxy());
                 SkString filename;
 #ifdef SK_BUILD_FOR_ANDROID
                 filename.printf("/sdcard/fontcache_%d%d%d.png", gDumpCount, i, pageIdx);
@@ -141,7 +141,7 @@
                 filename.printf("fontcache_%d%d%d.png", gDumpCount, i, pageIdx);
 #endif
                 auto ct = mask_format_to_gr_color_type(AtlasIndexToMaskFormat(i));
-                save_pixels(context, proxies[pageIdx].get(), ct, filename.c_str());
+                save_pixels(context, views[pageIdx].proxy(), ct, filename.c_str());
             }
         }
     }
diff --git a/src/gpu/text/GrAtlasManager.h b/src/gpu/text/GrAtlasManager.h
index 9e4f1c7..f21f35a 100644
--- a/src/gpu/text/GrAtlasManager.h
+++ b/src/gpu/text/GrAtlasManager.h
@@ -41,15 +41,15 @@
         return format;
     }
 
-    // if getProxies returns nullptr, the client must not try to use other functions on the
+    // if getViews returns nullptr, the client must not try to use other functions on the
     // GrStrikeCache which use the atlas.  This function *must* be called first, before other
     // functions which use the atlas. Note that we can have proxies available but none active
     // (i.e., none instantiated).
-    const sk_sp<GrTextureProxy>* getProxies(GrMaskFormat format, unsigned int* numActiveProxies) {
+    const GrSurfaceProxyView* getViews(GrMaskFormat format, unsigned int* numActiveProxies) {
         format = this->resolveMaskFormat(format);
         if (this->initAtlas(format)) {
             *numActiveProxies = this->getAtlas(format)->numActivePages();
-            return this->getAtlas(format)->getProxies();
+            return this->getAtlas(format)->getViews();
         }
         *numActiveProxies = 0;
         return nullptr;
diff --git a/tests/DrawOpAtlasTest.cpp b/tests/DrawOpAtlasTest.cpp
index 826d53d..b5c04cb 100644
--- a/tests/DrawOpAtlasTest.cpp
+++ b/tests/DrawOpAtlasTest.cpp
@@ -50,7 +50,7 @@
 int GrDrawOpAtlas::numAllocated_TestingOnly() const {
     int count = 0;
     for (uint32_t i = 0; i < this->maxPages(); ++i) {
-        if (fProxies[i]->isInstantiated()) {
+        if (fViews[i].proxy()->isInstantiated()) {
             ++count;
         }
     }
@@ -223,7 +223,7 @@
     // in the preparation of the text op
     auto atlasManager = context->priv().getAtlasManager();
     unsigned int numProxies;
-    atlasManager->getProxies(kA8_GrMaskFormat, &numProxies);
+    atlasManager->getViews(kA8_GrMaskFormat, &numProxies);
     atlasManager->setMaxPages_TestingOnly(0);
 
     flushState.setOpArgs(&opArgs);