Store GrSurfaceProxyView on shadow ops.

Bug: skia:9556
Change-Id: I04a5a44a6483c3e4d70b84b1d7df7ea9db6d44d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258814
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/gpu/effects/GrShadowGeoProc.cpp b/src/gpu/effects/GrShadowGeoProc.cpp
index a1c4c54..a914dda 100644
--- a/src/gpu/effects/GrShadowGeoProc.cpp
+++ b/src/gpu/effects/GrShadowGeoProc.cpp
@@ -7,6 +7,7 @@
 
 #include "src/gpu/effects/GrShadowGeoProc.h"
 
+#include "src/gpu/GrSurfaceProxyView.h"
 #include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
 #include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
 #include "src/gpu/glsl/GrGLSLUniformHandler.h"
@@ -61,16 +62,16 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-GrRRectShadowGeoProc::GrRRectShadowGeoProc(const GrTextureProxy* lut)
+GrRRectShadowGeoProc::GrRRectShadowGeoProc(const GrSurfaceProxyView& lutView)
         : INHERITED(kGrRRectShadowGeoProc_ClassID) {
     fInPosition = {"inPosition", kFloat2_GrVertexAttribType, kFloat2_GrSLType};
     fInColor = {"inColor", kUByte4_norm_GrVertexAttribType, kHalf4_GrSLType};
     fInShadowParams = {"inShadowParams", kFloat3_GrVertexAttribType, kHalf3_GrSLType};
     this->setVertexAttributes(&fInPosition, 3);
 
-    SkASSERT(lut);
-    fLUTTextureSampler.reset(GrSamplerState::ClampBilerp(), lut->backendFormat(),
-                             lut->textureSwizzle());
+    SkASSERT(lutView.proxy());
+    fLUTTextureSampler.reset(GrSamplerState::ClampBilerp(), lutView.proxy()->backendFormat(),
+                             lutView.swizzle());
     this->setTextureSamplerCnt(1);
 }
 
@@ -84,7 +85,11 @@
 
 #if GR_TEST_UTILS
 GrGeometryProcessor* GrRRectShadowGeoProc::TestCreate(GrProcessorTestData* d) {
-    return GrRRectShadowGeoProc::Make(d->allocator(),
-                                      d->textureProxy(GrProcessorUnitTest::kAlphaTextureIdx).get());
+    sk_sp<GrSurfaceProxy> proxy = d->textureProxy(GrProcessorUnitTest::kAlphaTextureIdx);
+    GrSurfaceOrigin origin = proxy->origin();
+    const GrSwizzle& swizzle = proxy->textureSwizzle();
+    GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
+
+    return GrRRectShadowGeoProc::Make(d->allocator(), view);
 }
 #endif
diff --git a/src/gpu/effects/GrShadowGeoProc.h b/src/gpu/effects/GrShadowGeoProc.h
index 1b9b49b..b103c86 100644
--- a/src/gpu/effects/GrShadowGeoProc.h
+++ b/src/gpu/effects/GrShadowGeoProc.h
@@ -13,6 +13,7 @@
 #include "src/gpu/GrProcessor.h"
 
 class GrGLRRectShadowGeoProc;
+class GrSurfaceProxyView;
 
 /**
  * The output color of this effect is a coverage mask for a rrect shadow,
@@ -20,8 +21,8 @@
  */
 class GrRRectShadowGeoProc : public GrGeometryProcessor {
 public:
-    static GrGeometryProcessor* Make(SkArenaAlloc* arena, const GrTextureProxy* lut) {
-        return arena->make<GrRRectShadowGeoProc>(lut);
+    static GrGeometryProcessor* Make(SkArenaAlloc* arena, const GrSurfaceProxyView& lutView) {
+        return arena->make<GrRRectShadowGeoProc>(lutView);
     }
 
     const char* name() const override { return "RRectShadow"; }
@@ -38,7 +39,7 @@
 private:
     friend class ::SkArenaAlloc; // for access to ctor
 
-    GrRRectShadowGeoProc(const GrTextureProxy* lut);
+    GrRRectShadowGeoProc(const GrSurfaceProxyView& lutView);
 
     const TextureSampler& onTextureSampler(int i) const override { return fLUTTextureSampler; }
 
@@ -54,5 +55,4 @@
     typedef GrGeometryProcessor INHERITED;
 };
 
-
 #endif