Pass swizzle into createProxy instead of inferring from GrPixelConfig.

This whole change is basically work that will all get reverted shortly
when GrSurfaceProxy no longer stores swizzle. But for now this helps
get rid of a use of pixel config.

Bug: skia:6718
Change-Id: If911360a8a9d2c52a58b5795386484634885b3f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265579
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp
index 2ea4ecb..cba7c1d 100644
--- a/tests/GrMipMappedTest.cpp
+++ b/tests/GrMipMappedTest.cpp
@@ -16,6 +16,7 @@
 #include "src/gpu/GrContextPriv.h"
 #include "src/gpu/GrDrawingManager.h"
 #include "src/gpu/GrGpu.h"
+#include "src/gpu/GrRecordingContextPriv.h"
 #include "src/gpu/GrRenderTargetContext.h"
 #include "src/gpu/GrSemaphore.h"
 #include "src/gpu/GrSurfaceProxyPriv.h"
@@ -345,9 +346,12 @@
     desc.fWidth = 1;
     desc.fHeight = 1;
     desc.fConfig = mipmapProxy->config();
+    GrSwizzle swizzle = context->priv().caps()->getReadSwizzle(mipmapProxy->backendFormat(),
+                                                               colorType);
     sk_sp<GrSurfaceProxy> renderTarget = proxyProvider->createProxy(
-            mipmapProxy->backendFormat(), desc, GrRenderable::kYes, 1, kTopLeft_GrSurfaceOrigin,
-            GrMipMapped::kNo, SkBackingFit::kApprox, SkBudgeted::kYes, GrProtected::kNo);
+            mipmapProxy->backendFormat(), desc, swizzle, GrRenderable::kYes, 1,
+            kTopLeft_GrSurfaceOrigin, GrMipMapped::kNo, SkBackingFit::kApprox, SkBudgeted::kYes,
+            GrProtected::kNo);
 
     auto rtc = GrRenderTargetContext::Make(
             context, colorType, nullptr, std::move(renderTarget), kTopLeft_GrSurfaceOrigin,
@@ -393,9 +397,12 @@
         desc.fWidth = 4;
         desc.fHeight = 4;
         desc.fConfig = config;
+
+        GrSwizzle swizzle = context->priv().caps()->getReadSwizzle(format, colorType);
+
         sk_sp<GrTextureProxy> mipmapProxy = proxyProvider->createProxy(
-                format, desc, GrRenderable::kYes, 1, kTopLeft_GrSurfaceOrigin, GrMipMapped::kYes,
-                SkBackingFit::kExact, SkBudgeted::kYes, GrProtected::kNo);
+                format, desc, swizzle, GrRenderable::kYes, 1, kTopLeft_GrSurfaceOrigin,
+                GrMipMapped::kYes, SkBackingFit::kExact, SkBudgeted::kYes, GrProtected::kNo);
 
         // Mark the mipmaps clean to ensure things still work properly when they won't be marked
         // dirty again until GrRenderTask::makeClosed().