Revert "Revert changes to unbreak bots."

This reverts commit 49721c84376bcb91daff84bcaa0225298866ee60.

Reason for revert: fixed double usage of plane release context in
 YUVUtils.

Original change's description:
> Revert changes to unbreak bots.
>
> f01a9d90209d824ea7449b06ad7c5e35349d6d17
> is the culprit
>
>
> Revert "GrRefCntedCallback has Make function."
>
> This reverts commit b2c42140ea10d1781917023a84465386f92d2a06.
>
> Revert "Add SkImage::MakeFromYUVATexturesCopyToExternal"
>
> This reverts commit f01a9d90209d824ea7449b06ad7c5e35349d6d17.
>
> Bug: skia:10632
> Change-Id: Ief076f168b63ff8ca15b607163a13d5f52a733d2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331798
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Change-Id: I41cdfe0d5b8587f85fae0c804c059c0d6ff92800


Bug: skia:10632
Change-Id: I41cdfe0d5b8587f85fae0c804c059c0d6ff92800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331876
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp
index 771bb9e..88753e0 100644
--- a/src/gpu/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/GrBackendTextureImageGenerator.cpp
@@ -127,8 +127,8 @@
         // The ref we add to fRefHelper here will be passed into and owned by the
         // GrRefCntedCallback.
         fRefHelper->ref();
-        releaseProcHelper.reset(
-                new GrRefCntedCallback(ReleaseRefHelper_TextureReleaseProc, fRefHelper));
+        releaseProcHelper =
+                GrRefCntedCallback::Make(ReleaseRefHelper_TextureReleaseProc, fRefHelper);
         fRefHelper->fBorrowingContextReleaseProc = releaseProcHelper.get();
     }
     fRefHelper->fBorrowingContextID = context->priv().contextID();
diff --git a/src/gpu/GrDirectContext.cpp b/src/gpu/GrDirectContext.cpp
index e17b569..b6b6558 100644
--- a/src/gpu/GrDirectContext.cpp
+++ b/src/gpu/GrDirectContext.cpp
@@ -511,10 +511,7 @@
                                                        GrProtected isProtected,
                                                        GrGpuFinishedProc finishedProc,
                                                        GrGpuFinishedContext finishedContext) {
-    sk_sp<GrRefCntedCallback> finishedCallback;
-    if (finishedProc) {
-        finishedCallback.reset(new GrRefCntedCallback(finishedProc, finishedContext));
-    }
+    auto finishedCallback = GrRefCntedCallback::Make(finishedProc, finishedContext);
 
     TRACE_EVENT0("skia.gpu", TRACE_FUNC);
     if (this->abandoned()) {
@@ -535,10 +532,7 @@
                                                        GrProtected isProtected,
                                                        GrGpuFinishedProc finishedProc,
                                                        GrGpuFinishedContext finishedContext) {
-    sk_sp<GrRefCntedCallback> finishedCallback;
-    if (finishedProc) {
-        finishedCallback.reset(new GrRefCntedCallback(finishedProc, finishedContext));
-    }
+    auto finishedCallback = GrRefCntedCallback::Make(finishedProc, finishedContext);
 
     if (this->abandoned()) {
         return {};
@@ -566,10 +560,7 @@
                                                        GrGpuFinishedContext finishedContext) {
     TRACE_EVENT0("skia.gpu", TRACE_FUNC);
 
-    sk_sp<GrRefCntedCallback> finishedCallback;
-    if (finishedProc) {
-        finishedCallback.reset(new GrRefCntedCallback(finishedProc, finishedContext));
-    }
+    auto finishedCallback = GrRefCntedCallback::Make(finishedProc, finishedContext);
 
     if (this->abandoned()) {
         return {};
@@ -606,10 +597,7 @@
                                            const SkColor4f& color,
                                            GrGpuFinishedProc finishedProc,
                                            GrGpuFinishedContext finishedContext) {
-    sk_sp<GrRefCntedCallback> finishedCallback;
-    if (finishedProc) {
-        finishedCallback.reset(new GrRefCntedCallback(finishedProc, finishedContext));
-    }
+    auto finishedCallback = GrRefCntedCallback::Make(finishedProc, finishedContext);
 
     if (this->abandoned()) {
         return false;
@@ -624,10 +612,7 @@
                                            const SkColor4f& color,
                                            GrGpuFinishedProc finishedProc,
                                            GrGpuFinishedContext finishedContext) {
-    sk_sp<GrRefCntedCallback> finishedCallback;
-    if (finishedProc) {
-        finishedCallback.reset(new GrRefCntedCallback(finishedProc, finishedContext));
-    }
+    auto finishedCallback = GrRefCntedCallback::Make(finishedProc, finishedContext);
 
     if (this->abandoned()) {
         return false;
@@ -651,10 +636,7 @@
                                            int numLevels,
                                            GrGpuFinishedProc finishedProc,
                                            GrGpuFinishedContext finishedContext) {
-    sk_sp<GrRefCntedCallback> finishedCallback;
-    if (finishedProc) {
-        finishedCallback.reset(new GrRefCntedCallback(finishedProc, finishedContext));
-    }
+    auto finishedCallback = GrRefCntedCallback::Make(finishedProc, finishedContext);
 
     if (this->abandoned()) {
         return false;
@@ -711,10 +693,7 @@
                                                              GrGpuFinishedProc finishedProc,
                                                              GrGpuFinishedContext finishedContext) {
     TRACE_EVENT0("skia.gpu", TRACE_FUNC);
-    sk_sp<GrRefCntedCallback> finishedCallback;
-    if (finishedProc) {
-        finishedCallback.reset(new GrRefCntedCallback(finishedProc, finishedContext));
-    }
+    auto finishedCallback = GrRefCntedCallback::Make(finishedProc, finishedContext);
 
     if (this->abandoned()) {
         return {};
@@ -749,10 +728,7 @@
                                                              GrGpuFinishedProc finishedProc,
                                                              GrGpuFinishedContext finishedContext) {
     TRACE_EVENT0("skia.gpu", TRACE_FUNC);
-    sk_sp<GrRefCntedCallback> finishedCallback;
-    if (finishedProc) {
-        finishedCallback.reset(new GrRefCntedCallback(finishedProc, finishedContext));
-    }
+    auto finishedCallback = GrRefCntedCallback::Make(finishedProc, finishedContext);
 
     if (this->abandoned()) {
         return {};
@@ -781,10 +757,7 @@
                                                      const SkColor4f& color,
                                                      GrGpuFinishedProc finishedProc,
                                                      GrGpuFinishedContext finishedContext) {
-    sk_sp<GrRefCntedCallback> finishedCallback;
-    if (finishedProc) {
-        finishedCallback.reset(new GrRefCntedCallback(finishedProc, finishedContext));
-    }
+    auto finishedCallback = GrRefCntedCallback::Make(finishedProc, finishedContext);
 
     if (this->abandoned()) {
         return false;
@@ -799,10 +772,7 @@
                                                      size_t dataSize,
                                                      GrGpuFinishedProc finishedProc,
                                                      GrGpuFinishedContext finishedContext) {
-    sk_sp<GrRefCntedCallback> finishedCallback;
-    if (finishedProc) {
-        finishedCallback.reset(new GrRefCntedCallback(finishedProc, finishedContext));
-    }
+    auto finishedCallback = GrRefCntedCallback::Make(finishedProc, finishedContext);
 
     if (this->abandoned()) {
         return false;
@@ -824,10 +794,7 @@
                                              GrBackendSurfaceMutableState* previousState,
                                              GrGpuFinishedProc finishedProc,
                                              GrGpuFinishedContext finishedContext) {
-    sk_sp<GrRefCntedCallback> callback;
-    if (finishedProc) {
-        callback.reset(new GrRefCntedCallback(finishedProc, finishedContext));
-    }
+    auto callback = GrRefCntedCallback::Make(finishedProc, finishedContext);
 
     if (this->abandoned()) {
         return false;
@@ -842,10 +809,7 @@
                                                   GrBackendSurfaceMutableState* previousState,
                                                   GrGpuFinishedProc finishedProc,
                                                   GrGpuFinishedContext finishedContext) {
-    sk_sp<GrRefCntedCallback> callback;
-    if (finishedProc) {
-        callback.reset(new GrRefCntedCallback(finishedProc, finishedContext));
-    }
+    auto callback = GrRefCntedCallback::Make(finishedProc, finishedContext);
 
     if (this->abandoned()) {
         return false;
diff --git a/src/gpu/GrSurface.h b/src/gpu/GrSurface.h
index 4e6b6da..0e50d6a 100644
--- a/src/gpu/GrSurface.h
+++ b/src/gpu/GrSurface.h
@@ -51,8 +51,7 @@
     typedef void* ReleaseCtx;
     typedef void (*ReleaseProc)(ReleaseCtx);
     void setRelease(ReleaseProc proc, ReleaseCtx ctx) {
-        sk_sp<GrRefCntedCallback> helper(new GrRefCntedCallback(proc, ctx));
-        this->setRelease(std::move(helper));
+        this->setRelease(GrRefCntedCallback::Make(proc, ctx));
     }
 
     /**
diff --git a/src/gpu/GrTexture.h b/src/gpu/GrTexture.h
index ce7ffed..0a3347d 100644
--- a/src/gpu/GrTexture.h
+++ b/src/gpu/GrTexture.h
@@ -64,7 +64,7 @@
     void addIdleProc(GrRefCntedCallback::Callback callback,
                      GrRefCntedCallback::Context context,
                      IdleState state) {
-        this->addIdleProc(sk_make_sp<GrRefCntedCallback>(callback, context), state);
+        this->addIdleProc(GrRefCntedCallback::Make(callback, context), state);
     }
 
     GrTextureType textureType() const { return fTextureType; }
diff --git a/src/gpu/d3d/GrD3DGpu.cpp b/src/gpu/d3d/GrD3DGpu.cpp
index 1dc7078..a9a7c6d 100644
--- a/src/gpu/d3d/GrD3DGpu.cpp
+++ b/src/gpu/d3d/GrD3DGpu.cpp
@@ -213,9 +213,7 @@
 void GrD3DGpu::addFinishedProc(GrGpuFinishedProc finishedProc,
                                GrGpuFinishedContext finishedContext) {
     SkASSERT(finishedProc);
-    sk_sp<GrRefCntedCallback> finishedCallback(
-            new GrRefCntedCallback(finishedProc, finishedContext));
-    this->addFinishedCallback(std::move(finishedCallback));
+    this->addFinishedCallback(GrRefCntedCallback::Make(finishedProc, finishedContext));
 }
 
 void GrD3DGpu::addFinishedCallback(sk_sp<GrRefCntedCallback> finishedCallback) {
diff --git a/src/gpu/mtl/GrMtlGpu.mm b/src/gpu/mtl/GrMtlGpu.mm
index 4b20c20..3bed568 100644
--- a/src/gpu/mtl/GrMtlGpu.mm
+++ b/src/gpu/mtl/GrMtlGpu.mm
@@ -274,9 +274,7 @@
 void GrMtlGpu::addFinishedProc(GrGpuFinishedProc finishedProc,
                                GrGpuFinishedContext finishedContext) {
     SkASSERT(finishedProc);
-    sk_sp<GrRefCntedCallback> finishedCallback(
-            new GrRefCntedCallback(finishedProc, finishedContext));
-    this->addFinishedCallback(std::move(finishedCallback));
+    this->addFinishedCallback(GrRefCntedCallback::Make(finishedProc, finishedContext));
 }
 
 void GrMtlGpu::addFinishedCallback(sk_sp<GrRefCntedCallback> finishedCallback) {
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 6b397f4..7d22ccd 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -2111,9 +2111,7 @@
 void GrVkGpu::addFinishedProc(GrGpuFinishedProc finishedProc,
                               GrGpuFinishedContext finishedContext) {
     SkASSERT(finishedProc);
-    sk_sp<GrRefCntedCallback> finishedCallback(
-            new GrRefCntedCallback(finishedProc, finishedContext));
-    this->addFinishedCallback(std::move(finishedCallback));
+    this->addFinishedCallback(GrRefCntedCallback::Make(finishedProc, finishedContext));
 }
 
 void GrVkGpu::addFinishedCallback(sk_sp<GrRefCntedCallback> finishedCallback) {