Remove SkAutoTUnref and SkAutoTDelete from public includes.

This also makes the required changed to src, tests, and tools. The few
public APIs modified by this change appear to be unused outside of Skia.

Removing these from the public API makes it easier to ensure users are
no longer using them.

This also updates GrGpu::wrapBackendXXX and the
::onWrapBackendXXX methods to clarify ownership.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2448593002

Review-Url: https://codereview.chromium.org/2448593002
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index c9315bb..6af8491 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -23,17 +23,17 @@
 #include "SkMipMap.h"
 #include "SkPixelRef.h"
 
-SkImage_Gpu::SkImage_Gpu(int w, int h, uint32_t uniqueID, SkAlphaType at, GrTexture* tex,
+SkImage_Gpu::SkImage_Gpu(int w, int h, uint32_t uniqueID, SkAlphaType at, sk_sp<GrTexture> tex,
                          sk_sp<SkColorSpace> colorSpace, SkBudgeted budgeted)
     : INHERITED(w, h, uniqueID)
-    , fTexture(SkRef(tex))
+    , fTexture(std::move(tex))
     , fAlphaType(at)
     , fBudgeted(budgeted)
     , fColorSpace(std::move(colorSpace))
     , fAddedRasterVersionToCache(false)
 {
-    SkASSERT(tex->width() == w);
-    SkASSERT(tex->height() == h);
+    SkASSERT(fTexture->width() == w);
+    SkASSERT(fTexture->height() == h);
 }
 
 SkImage_Gpu::~SkImage_Gpu() {
@@ -149,9 +149,9 @@
     if (!subTx) {
         return nullptr;
     }
-    ctx->copySurface(subTx.get(), fTexture, subset, SkIPoint::Make(0, 0));
+    ctx->copySurface(subTx.get(), fTexture.get(), subset, SkIPoint::Make(0, 0));
     return sk_make_sp<SkImage_Gpu>(desc.fWidth, desc.fHeight, kNeedNewImageUniqueID,
-                                   fAlphaType, subTx.get(), fColorSpace, fBudgeted);
+                                   fAlphaType, std::move(subTx), fColorSpace, fBudgeted);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -164,7 +164,7 @@
     if (desc.fWidth <= 0 || desc.fHeight <= 0) {
         return nullptr;
     }
-    SkAutoTUnref<GrTexture> tex(ctx->textureProvider()->wrapBackendTexture(desc, ownership));
+    sk_sp<GrTexture> tex = ctx->textureProvider()->wrapBackendTexture(desc, ownership);
     if (!tex) {
         return nullptr;
     }
@@ -174,7 +174,7 @@
 
     const SkBudgeted budgeted = SkBudgeted::kNo;
     return sk_make_sp<SkImage_Gpu>(desc.fWidth, desc.fHeight, kNeedNewImageUniqueID,
-                                   at, tex, colorSpace, budgeted);
+                                   at, std::move(tex), std::move(colorSpace), budgeted);
 }
 
 sk_sp<SkImage> SkImage::MakeFromTexture(GrContext* ctx, const GrBackendTextureDesc& desc,
@@ -271,7 +271,7 @@
     drawContext->drawRect(GrNoClip(), paint, SkMatrix::I(), rect);
     ctx->flushSurfaceWrites(drawContext->accessRenderTarget());
     return sk_make_sp<SkImage_Gpu>(width, height, kNeedNewImageUniqueID,
-                                   kOpaque_SkAlphaType, drawContext->asTexture().get(),
+                                   kOpaque_SkAlphaType, drawContext->asTexture(),
                                    sk_ref_sp(drawContext->getColorSpace()), budgeted);
 }
 
@@ -293,12 +293,12 @@
 }
 
 static sk_sp<SkImage> create_image_from_maker(GrTextureMaker* maker, SkAlphaType at, uint32_t id) {
-    SkAutoTUnref<GrTexture> texture(maker->refTextureForParams(GrTextureParams::ClampNoFilter(),
-                                                               SkSourceGammaTreatment::kRespect));
+    sk_sp<GrTexture> texture(maker->refTextureForParams(GrTextureParams::ClampNoFilter(),
+                                                        SkSourceGammaTreatment::kRespect));
     if (!texture) {
         return nullptr;
     }
-    return sk_make_sp<SkImage_Gpu>(texture->width(), texture->height(), id, at, texture,
+    return sk_make_sp<SkImage_Gpu>(texture->width(), texture->height(), id, at, std::move(texture),
                                    sk_ref_sp(maker->getColorSpace()), SkBudgeted::kNo);
 }
 
@@ -345,12 +345,12 @@
     if (!ctx) {
         return nullptr;
     }
-    SkAutoTUnref<GrTexture> texture(GrUploadPixmapToTexture(ctx, pixmap, budgeted));
+    sk_sp<GrTexture> texture(GrUploadPixmapToTexture(ctx, pixmap, budgeted));
     if (!texture) {
         return nullptr;
     }
     return sk_make_sp<SkImage_Gpu>(texture->width(), texture->height(), kNeedNewImageUniqueID,
-                                   pixmap.alphaType(), texture,
+                                   pixmap.alphaType(), std::move(texture),
                                    sk_ref_sp(pixmap.info().colorSpace()), budgeted);
 }
 
@@ -702,12 +702,12 @@
     if (!ctx) {
         return nullptr;
     }
-    SkAutoTUnref<GrTexture> texture(GrUploadMipMapToTexture(ctx, info, texels, mipLevelCount));
+    sk_sp<GrTexture> texture(GrUploadMipMapToTexture(ctx, info, texels, mipLevelCount));
     if (!texture) {
         return nullptr;
     }
     texture->texturePriv().setGammaTreatment(gammaTreatment);
     return sk_make_sp<SkImage_Gpu>(texture->width(), texture->height(), kNeedNewImageUniqueID,
-                                   info.alphaType(), texture, sk_ref_sp(info.colorSpace()),
-                                   budgeted);
+                                   info.alphaType(), std::move(texture),
+                                   sk_ref_sp(info.colorSpace()), budgeted);
 }