Treat GrTextureAdjusters mip copy like other producers, i.e. no fallback.

This makes sure that when we are not using repeat mode the colorType of
the producer will match the colorType of the returned proxy.

Bug: chromium:1044862
Change-Id: I9627517c383ff7c3e9801da21ddafdacfb747871
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266218
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrTextureAdjuster.cpp b/src/gpu/GrTextureAdjuster.cpp
index 529d33d..66f6266 100644
--- a/src/gpu/GrTextureAdjuster.cpp
+++ b/src/gpu/GrTextureAdjuster.cpp
@@ -34,7 +34,8 @@
 }
 
 sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxyCopy(const CopyParams& copyParams,
-                                                             bool willBeMipped) {
+                                                             bool willBeMipped,
+                                                             bool copyForMipsOnly) {
     GrProxyProvider* proxyProvider = this->context()->priv().proxyProvider();
 
     GrUniqueKey key;
@@ -50,8 +51,13 @@
 
     sk_sp<GrTextureProxy> proxy = this->originalProxyRef();
 
-    sk_sp<GrTextureProxy> copy = CopyOnGpu(this->context(), std::move(proxy), this->colorType(),
-                                           copyParams, willBeMipped);
+    sk_sp<GrTextureProxy> copy;
+    if (copyForMipsOnly) {
+        copy = GrCopyBaseMipMapToTextureProxy(this->context(), proxy.get(), this->colorType());
+    } else {
+        copy = CopyOnGpu(this->context(), std::move(proxy), this->colorType(),
+                         copyParams, willBeMipped);
+    }
     if (copy) {
         if (key.isValid()) {
             SkASSERT(copy->origin() == this->originalProxy()->origin());
@@ -98,7 +104,8 @@
         }
     }
 
-    sk_sp<GrTextureProxy> result = this->refTextureProxyCopy(copyParams, willBeMipped);
+    sk_sp<GrTextureProxy> result = this->refTextureProxyCopy(copyParams, willBeMipped,
+                                                             needsCopyForMipsOnly);
     if (!result && needsCopyForMipsOnly) {
         // If we were unable to make a copy and we only needed a copy for mips, then we will return
         // the source texture here and require that the GPU backend is able to fall back to using
diff --git a/src/gpu/GrTextureAdjuster.h b/src/gpu/GrTextureAdjuster.h
index 9bac73a..cc69325 100644
--- a/src/gpu/GrTextureAdjuster.h
+++ b/src/gpu/GrTextureAdjuster.h
@@ -44,7 +44,8 @@
                                                      bool willBeMipped,
                                                      SkScalar scaleAdjust[2]) override;
 
-    sk_sp<GrTextureProxy> refTextureProxyCopy(const CopyParams& copyParams, bool willBeMipped);
+    sk_sp<GrTextureProxy> refTextureProxyCopy(const CopyParams& copyParams, bool willBeMipped,
+                                              bool copyOnlyForMips);
 
     sk_sp<GrTextureProxy> fOriginal;
     uint32_t fUniqueID;