sk_gpu_test::MakeTextureProxyFromData -> MakeTextureProxyViewFromData

Change-Id: Ie55a147566ef68a64e3b03d8cab701e54dbf1f0d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309780
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/tools/gpu/ProxyUtils.cpp b/tools/gpu/ProxyUtils.cpp
index 0c4b2e3..b740c63 100644
--- a/tools/gpu/ProxyUtils.cpp
+++ b/tools/gpu/ProxyUtils.cpp
@@ -21,21 +21,21 @@
 
 namespace sk_gpu_test {
 
-sk_sp<GrTextureProxy> MakeTextureProxyFromData(GrDirectContext* dContext,
-                                               GrRenderable renderable,
-                                               GrSurfaceOrigin origin,
-                                               const GrImageInfo& imageInfo,
-                                               const void* data,
-                                               size_t rowBytes) {
+GrSurfaceProxyView MakeTextureProxyViewFromData(GrDirectContext* dContext,
+                                                GrRenderable renderable,
+                                                GrSurfaceOrigin origin,
+                                                const GrImageInfo& imageInfo,
+                                                const void* data,
+                                                size_t rowBytes) {
     if (dContext->abandoned()) {
-        return nullptr;
+        return {};
     }
 
     const GrCaps* caps = dContext->priv().caps();
 
     const GrBackendFormat format = caps->getDefaultBackendFormat(imageInfo.colorType(), renderable);
     if (!format.isValid()) {
-        return nullptr;
+        return {};
     }
     GrSwizzle swizzle = caps->getReadSwizzle(format, imageInfo.colorType());
 
@@ -45,18 +45,18 @@
                                                           SkBackingFit::kExact, SkBudgeted::kYes,
                                                           GrProtected::kNo);
     if (!proxy) {
-        return nullptr;
+        return {};
     }
     GrSurfaceProxyView view(proxy, origin, swizzle);
     auto sContext = GrSurfaceContext::Make(dContext, std::move(view), imageInfo.colorType(),
                                            imageInfo.alphaType(), imageInfo.refColorSpace());
     if (!sContext) {
-        return nullptr;
+        return {};
     }
     if (!sContext->writePixels(dContext, imageInfo, data, rowBytes, {0, 0})) {
-        return nullptr;
+        return {};
     }
-    return proxy;
+    return sContext->readSurfaceView();
 }
 
 GrProgramInfo* CreateProgramInfo(const GrCaps* caps,