Revert "Remove GrCaps::SupportedRead::fSwizzle and supporting code"

This reverts commit 1cec69ae5cdc2c183f6a2115d60ebdf796a89a92.

Reason for revert: Causing Valgrind failures

Original change's description:
> Remove GrCaps::SupportedRead::fSwizzle and supporting code
> 
> Add weird color types that handle the swizzling.
> 
> Change-Id: Ie37a00eb877fe5e519f7498bf749e02a2f1dc204
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230135
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: I710e1952f2cef1a1e6e7ccf408b8a71ce721c002
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231262
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp
index a66b391..32714b8 100644
--- a/src/gpu/GrCaps.cpp
+++ b/src/gpu/GrCaps.cpp
@@ -361,13 +361,11 @@
     if (GrColorType::kRGB_888x == read.fColorType) {
         read.fOffsetAlignmentForTransferBuffer = 0;
     }
-    // It's very convenient to access 1 byte-per-channel 32 bit color types as uint32_t on the CPU.
+    // It's very convenient to access 1 byte-per-channel 32 bitvRGB/RGBA color types as uint32_t.
     // Make those aligned reads out of the buffer even if the underlying API doesn't require it.
     auto componentFlags = GrColorTypeComponentFlags(read.fColorType);
     if ((componentFlags == kRGBA_SkColorTypeComponentFlags ||
-         componentFlags == kRGB_SkColorTypeComponentFlags  ||
-         componentFlags == kAlpha_SkColorTypeComponentFlag ||
-         componentFlags == kGray_SkColorTypeComponentFlag) &&
+         componentFlags == kRGB_SkColorTypeComponentFlags) &&
         GrColorTypeBytesPerPixel(read.fColorType) == 4) {
         switch (read.fOffsetAlignmentForTransferBuffer & 0b11) {
             // offset alignment already a multiple of 4
diff --git a/src/gpu/GrCaps.h b/src/gpu/GrCaps.h
index 19a993e..61df9db 100644
--- a/src/gpu/GrCaps.h
+++ b/src/gpu/GrCaps.h
@@ -237,6 +237,7 @@
                                                          GrColorType srcColorType) const = 0;
 
     struct SupportedRead {
+        GrSwizzle fSwizzle;
         GrColorType fColorType;
         // If the read is occurring using GrGpu::transferPixelsFrom then this provides the
         // minimum alignment of the offset into the transfer buffer.
diff --git a/src/gpu/GrDataUtils.cpp b/src/gpu/GrDataUtils.cpp
index 45d2ff8..a36a271 100644
--- a/src/gpu/GrDataUtils.cpp
+++ b/src/gpu/GrDataUtils.cpp
@@ -390,15 +390,6 @@
         case GrColorType::kRGBA_F32:         *load = SkRasterPipeline::load_f32;
                                              *isNormalized = false;
                                              break;
-        case GrColorType::kAlpha_8xxx:       *load = SkRasterPipeline::load_8888;
-                                             swizzle = GrSwizzle("000r");
-                                             break;
-        case GrColorType::kAlpha_F32xxx:     *load = SkRasterPipeline::load_f32;
-                                             swizzle = GrSwizzle("000r");
-                                             break;
-        case GrColorType::kGray_8xxx:       *load = SkRasterPipeline::load_8888;
-                                             swizzle = GrSwizzle("rrr1");
-                                             break;
         case GrColorType::kR_16:             *load = SkRasterPipeline::load_a16;
                                              swizzle = GrSwizzle("a001");
                                              break;
@@ -449,12 +440,6 @@
         case GrColorType::kRGBA_F32:         *store = SkRasterPipeline::store_f32;
                                              *isNormalized = false;
                                              break;
-        case GrColorType::kAlpha_8xxx:       *store = SkRasterPipeline::store_8888;
-                                             swizzle = GrSwizzle("a000");
-                                             break;
-        case GrColorType::kAlpha_F32xxx:     *store = SkRasterPipeline::store_f32;
-                                             swizzle = GrSwizzle("a000");
-                                             break;
         case GrColorType::kR_16:             swizzle = GrSwizzle("000r");
                                              *store = SkRasterPipeline::store_a16;
                                              break;
@@ -466,7 +451,6 @@
                                              break;
 
         case GrColorType::kGray_8:  // not currently supported as output
-        case GrColorType::kGray_8xxx:  // not currently supported as output
         case GrColorType::kUnknown:
             SK_ABORT("unexpected CT");
     }
@@ -482,7 +466,7 @@
 
 bool GrConvertPixels(const GrPixelInfo& dstInfo,       void* dst, size_t dstRB,
                      const GrPixelInfo& srcInfo, const void* src, size_t srcRB,
-                     bool flipY) {
+                     bool flipY, GrSwizzle swizzle) {
     TRACE_EVENT0("skia.gpu", TRACE_FUNC);
     if (!srcInfo.isValid() || !dstInfo.isValid()) {
         return false;
@@ -513,6 +497,7 @@
     bool srcIsSRGB;
     auto loadSwizzle = get_load_and_get_swizzle(srcInfo.colorType(), &load, &srcIsNormalized,
                                                 &srcIsSRGB);
+    loadSwizzle = GrSwizzle::Concat(loadSwizzle, swizzle);
 
     SkRasterPipeline::StockStage store;
     bool dstIsNormalized;
@@ -598,6 +583,7 @@
     return true;
 }
 
+
 GrColorType SkColorTypeAndFormatToGrColorType(const GrCaps* caps,
                                               SkColorType skCT,
                                               const GrBackendFormat& format) {
diff --git a/src/gpu/GrDataUtils.h b/src/gpu/GrDataUtils.h
index c72feb7..5417ac9 100644
--- a/src/gpu/GrDataUtils.h
+++ b/src/gpu/GrDataUtils.h
@@ -107,6 +107,6 @@
 // Swizzle param is applied after loading and before converting from srcInfo to dstInfo.
 bool GrConvertPixels(const GrPixelInfo& dstInfo,       void* dst, size_t dstRB,
                      const GrPixelInfo& srcInfo, const void* src, size_t srcRB,
-                     bool flipY = false);
+                     bool flipY = false, GrSwizzle swizzle = GrSwizzle{});
 
 #endif
diff --git a/src/gpu/GrSurfaceContext.cpp b/src/gpu/GrSurfaceContext.cpp
index 630fea3..15dad7a 100644
--- a/src/gpu/GrSurfaceContext.cpp
+++ b/src/gpu/GrSurfaceContext.cpp
@@ -180,7 +180,8 @@
     bool makeTight = !caps->readPixelsRowBytesSupport() && tightRowBytes != rowBytes;
 
     bool convert = unpremul || premul || needColorConversion || flip || makeTight ||
-                   (dstInfo.colorType() != supportedRead.fColorType);
+                   (dstInfo.colorType() != supportedRead.fColorType) ||
+                   supportedRead.fSwizzle != GrSwizzle::RGBA();
 
     std::unique_ptr<char[]> tmpPixels;
     GrPixelInfo tmpInfo;
@@ -208,7 +209,8 @@
     }
 
     if (convert) {
-        return GrConvertPixels(dstInfo, dst, rowBytes, tmpInfo, readDst, readRB, flip);
+        return GrConvertPixels(dstInfo, dst, rowBytes, tmpInfo, readDst, readRB, flip,
+                               supportedRead.fSwizzle);
     }
     return true;
 }
@@ -627,14 +629,14 @@
     PixelTransferResult result;
     result.fTransferBuffer = std::move(buffer);
     auto at = this->colorSpaceInfo().alphaType();
-    if (supportedRead.fColorType != dstCT || flip) {
+    if (supportedRead.fColorType != dstCT || supportedRead.fSwizzle != GrSwizzle("rgba") || flip) {
         result.fPixelConverter = [w = rect.width(), h = rect.height(), dstCT, supportedRead, at](
                 void* dst, const void* src) {
               GrPixelInfo srcInfo(supportedRead.fColorType, at, nullptr, w, h);
               GrPixelInfo dstInfo(dstCT,                    at, nullptr, w, h);
               GrConvertPixels(dstInfo, dst, dstInfo.minRowBytes(),
                               srcInfo, src, srcInfo.minRowBytes(),
-                              /* flipY = */ false);
+                              /* flipY = */ false, supportedRead.fSwizzle);
         };
     }
     return result;
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 668448b..09a93a2 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -308,9 +308,6 @@
         case GrColorType::kRGBA_F16:
         case GrColorType::kRGBA_F16_Clamped:
         case GrColorType::kAlpha_8:
-        case GrColorType::kAlpha_8xxx:
-        case GrColorType::kAlpha_F32xxx:
-        case GrColorType::kGray_8xxx:
             return -1;
     }
     SkUNREACHABLE;
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 20320be..529e5a4 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -1590,13 +1590,14 @@
                     ioFormat.fExternalReadFormat = 0;
                 }
 
-                // Format: R8, Surface: kAlpha_8, Data: kAlpha_8xxx
+                // Format: R8, Surface: kAlpha_8, Data: kRGBA_8888
                 {
                     auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
-                    ioFormat.fColorType = GrColorType::kAlpha_8xxx;
+                    ioFormat.fColorType = GrColorType::kRGBA_8888;
                     ioFormat.fExternalType = GR_GL_UNSIGNED_BYTE;
                     ioFormat.fExternalTexImageFormat = 0;
                     ioFormat.fExternalReadFormat = GR_GL_RGBA;
+                    ioFormat.fReadSwizzle = GrSwizzle("000r");
                 }
             }
 
@@ -1621,13 +1622,14 @@
                     ioFormat.fExternalReadFormat = 0;
                 }
 
-                // Format: R8, Surface: kGray_8, Data: kGray_8xxx
+                // Format: R8, Surface: kGray_8, Data: kRGBA_8888
                 {
                     auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
-                    ioFormat.fColorType = GrColorType::kGray_8xxx;
+                    ioFormat.fColorType = GrColorType::kRGBA_8888;
                     ioFormat.fExternalType = GR_GL_UNSIGNED_BYTE;
                     ioFormat.fExternalTexImageFormat = 0;
                     ioFormat.fExternalReadFormat = GR_GL_RGBA;
+                    ioFormat.fReadSwizzle = GrSwizzle("rrr1");
                 }
             }
         }
@@ -1702,6 +1704,7 @@
                         ioFormat.fExternalType = GR_GL_UNSIGNED_BYTE;
                         ioFormat.fExternalTexImageFormat = 0;
                         ioFormat.fExternalReadFormat = GR_GL_RGBA;
+                        ioFormat.fReadSwizzle = GrSwizzle("000a");
                     }
                 }
             }
@@ -2100,13 +2103,14 @@
                     ioFormat.fExternalReadFormat = 0;
                 }
 
-                // Format: R16F, Surface: kAlpha_F16, Data: kAlpha_F32xxx
+                // Format: R16F, Surface: kAlpha_F16, Data: kRGBA_F32
                 {
                     auto& ioFormat = ctInfo.fExternalIOFormats[ioIdx++];
-                    ioFormat.fColorType = GrColorType::kAlpha_F32xxx;
+                    ioFormat.fColorType = GrColorType::kRGBA_F32;
                     ioFormat.fExternalType = GR_GL_FLOAT;
                     ioFormat.fExternalTexImageFormat = 0;
                     ioFormat.fExternalReadFormat = GR_GL_RGBA;
+                    ioFormat.fReadSwizzle = GrSwizzle("000r");
                 }
             }
         }
@@ -3684,12 +3688,12 @@
     // this as makes sense to increase performance and correctness.
     GrGLFormat srcFormat = GrGLBackendFormatToGLFormat(srcBackendFormat);
     if (srcFormat == GrGLFormat::kUnknown) {
-        return {GrColorType::kUnknown, 0};
+        return {GrSwizzle{}, GrColorType::kUnknown, 0};
     }
 
     // We first try to find a supported read pixels GrColorType that matches the requested
     // dstColorType. If that doesn't exists we will use any valid read pixels GrColorType.
-    GrCaps::SupportedRead fallbackRead = {GrColorType::kUnknown, 0};
+    GrCaps::SupportedRead fallbackRead = {GrSwizzle{}, GrColorType::kUnknown, 0};
     const auto& formatInfo = this->getFormatInfo(srcFormat);
     bool foundSrcCT = false;
     for (int i = 0; !foundSrcCT && i < formatInfo.fColorTypeInfoCount; ++i) {
@@ -3702,12 +3706,13 @@
                     GrGLenum transferOffsetAlignment =
                             offset_alignment_for_transfer_buffer(ioInfo.fExternalType);
                     if (ioInfo.fColorType == dstColorType) {
-                        return {dstColorType, transferOffsetAlignment};
+                        return {ioInfo.fReadSwizzle, dstColorType, transferOffsetAlignment};
                     }
                     // Currently we just pick the first supported format that we find as our
                     // fallback.
                     if (fallbackRead.fColorType == GrColorType::kUnknown) {
-                        fallbackRead = {ioInfo.fColorType, transferOffsetAlignment};
+                        fallbackRead = {ioInfo.fReadSwizzle, ioInfo.fColorType,
+                                        transferOffsetAlignment};
                     }
                 }
             }
@@ -3996,12 +4001,6 @@
                 return kRG_half_GrPixelConfig;
             }
             break;
-
-        // These have no equivalent config:
-        case GrColorType::kAlpha_8xxx:
-        case GrColorType::kAlpha_F32xxx:
-        case GrColorType::kGray_8xxx:
-            break;
     }
 
     SkDebugf("Unknown pixel config 0x%x\n", format);
@@ -4075,7 +4074,7 @@
 bool GrGLCaps::canClearTextureOnCreation() const { return fClearTextureSupport; }
 
 #ifdef SK_DEBUG
-static constexpr bool format_color_type_valid_pair(GrGLenum format, GrColorType colorType) {
+static bool format_color_type_valid_pair(GrGLenum format, GrColorType colorType) {
     switch (colorType) {
         case GrColorType::kUnknown:
             return false;
@@ -4120,13 +4119,9 @@
         case GrColorType::kRG_F16:
             return GR_GL_RG16F == format;
 
-        // These have no equivalent config:
-        case GrColorType::kAlpha_8xxx:
-        case GrColorType::kAlpha_F32xxx:
-        case GrColorType::kGray_8xxx:
-            return false;
     }
-    SkUNREACHABLE;
+    SK_ABORT("Unknown color type");
+    return false;
 }
 #endif
 
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 64be61a..57bd50e 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -611,6 +611,10 @@
             GrGLenum fExternalType = 0;
             GrGLenum fExternalTexImageFormat = 0;
             GrGLenum fExternalReadFormat = 0;
+
+            // This is the swizzle to apply to the data after it is read back using the
+            // fExternalReadFormat so that the data is in the form expected by fColorType.
+            GrSwizzle fReadSwizzle = GrSwizzle::RGBA();
         };
 
         GrGLenum externalFormat(GrColorType externalColorType, ExternalFormatUsage usage) const {
diff --git a/src/gpu/mock/GrMockCaps.h b/src/gpu/mock/GrMockCaps.h
index 23a47a4..3f4e5a0 100644
--- a/src/gpu/mock/GrMockCaps.h
+++ b/src/gpu/mock/GrMockCaps.h
@@ -184,7 +184,7 @@
 
     SupportedRead onSupportedReadPixelsColorType(GrColorType srcColorType, const GrBackendFormat&,
                                                  GrColorType) const override {
-        return SupportedRead{srcColorType, 1};
+        return SupportedRead{GrSwizzle::RGBA(), srcColorType, 1};
     }
 
     static const int kMaxSampleCnt = 16;
diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm
index 1b7e30d..56ad7e8 100644
--- a/src/gpu/mtl/GrMtlCaps.mm
+++ b/src/gpu/mtl/GrMtlCaps.mm
@@ -599,7 +599,7 @@
 }
 
 // A near clone of format_color_type_valid_pair
-static constexpr GrPixelConfig validate_sized_format(GrMTLPixelFormat grFormat, GrColorType ct) {
+GrPixelConfig validate_sized_format(GrMTLPixelFormat grFormat, GrColorType ct) {
     MTLPixelFormat format = static_cast<MTLPixelFormat>(grFormat);
     switch (ct) {
         case GrColorType::kUnknown:
@@ -615,6 +615,7 @@
         case GrColorType::kBGR_565:
         case GrColorType::kABGR_4444:
             return kUnknown_GrPixelConfig;
+            break;
 #else
         case GrColorType::kBGR_565:
             if (MTLPixelFormatB5G6R5Unorm == format) {
@@ -702,12 +703,9 @@
                 return kRG_half_GrPixelConfig;
             }
             break;
-        case GrColorType::kAlpha_8xxx:
-        case GrColorType::kAlpha_F32xxx:
-        case GrColorType::kGray_8xxx:
-            return kUnknown_GrPixelConfig;
     }
-    SkUNREACHABLE;
+
+    return kUnknown_GrPixelConfig;
 }
 
 bool GrMtlCaps::onAreColorTypeAndFormatCompatible(GrColorType ct,
@@ -784,7 +782,7 @@
 }
 
 #ifdef SK_DEBUG
-static constexpr bool format_color_type_valid_pair(MTLPixelFormat format, GrColorType colorType) {
+static bool format_color_type_valid_pair(MTLPixelFormat format, GrColorType colorType) {
     switch (colorType) {
         case GrColorType::kUnknown:
             return false;
@@ -839,12 +837,9 @@
             return MTLPixelFormatRGBA16Unorm == format;
         case GrColorType::kRG_F16:
             return MTLPixelFormatRG16Float == format;
-        case GrColorType::kAlpha_8xxx:
-        case GrColorType::kAlpha_F32xxx:
-        case GrColorType::kGray_8xxx:
-            return false;
     }
-    SkUNREACHABLE;
+    SK_ABORT("Unknown color type");
+    return false;
 }
 #endif
 
@@ -907,7 +902,7 @@
         GrColorType dstColorType) const {
     const GrMTLPixelFormat* grMtlFormat = srcBackendFormat.getMtlFormat();
     if (!grMtlFormat) {
-        return {GrColorType::kUnknown, 0};
+        return {GrSwizzle(), GrColorType::kUnknown, 0};
     }
 
     GrColorType readCT = GrColorType::kUnknown;
@@ -979,6 +974,6 @@
     }
     // Metal requires the destination offset for copyFromTexture to be a multiple of the textures
     // pixels size.
-    return {readCT, GrColorTypeBytesPerPixel(readCT)};
+    return {GrSwizzle::RGBA(), readCT, GrColorTypeBytesPerPixel(readCT)};
 }
 
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 259a5ad..563fb65 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -1065,11 +1065,6 @@
                 return kRG_half_GrPixelConfig;
             }
             break;
-        // These have no equivalent:
-        case GrColorType::kAlpha_8xxx:
-        case GrColorType::kAlpha_F32xxx:
-        case GrColorType::kGray_8xxx:
-            break;
     }
 
     return kUnknown_GrPixelConfig;
@@ -1147,7 +1142,7 @@
 bool GrVkCaps::canClearTextureOnCreation() const { return true; }
 
 #ifdef SK_DEBUG
-static constexpr bool format_color_type_valid_pair(VkFormat vkFormat, GrColorType colorType) {
+static bool format_color_type_valid_pair(VkFormat vkFormat, GrColorType colorType) {
     switch (colorType) {
         case GrColorType::kUnknown:
             return false;
@@ -1192,12 +1187,9 @@
             return VK_FORMAT_R16G16B16A16_UNORM == vkFormat;
         case GrColorType::kRG_F16:
             return VK_FORMAT_R16G16_SFLOAT == vkFormat;
-        case GrColorType::kAlpha_8xxx:
-        case GrColorType::kAlpha_F32xxx:
-        case GrColorType::kGray_8xxx:
-            return false;
     }
-    SkUNREACHABLE;
+    SK_ABORT("Unknown color type");
+    return false;
 }
 #endif
 
@@ -1248,7 +1240,7 @@
         GrColorType dstColorType) const {
     const VkFormat* vkFormat = srcBackendFormat.getVkFormat();
     if (!vkFormat) {
-        return {GrColorType::kUnknown, 0};
+        return {GrSwizzle(), GrColorType::kUnknown, 0};
     }
 
     // The VkBufferImageCopy bufferOffset field must be both a multiple of 4 and of a single texel.
@@ -1256,53 +1248,53 @@
 
     switch (*vkFormat) {
         case VK_FORMAT_R8G8B8A8_UNORM:
-            return {GrColorType::kRGBA_8888, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kRGBA_8888, offsetAlignment};
         case VK_FORMAT_R8_UNORM:
             if (srcColorType == GrColorType::kAlpha_8) {
-                return {GrColorType::kAlpha_8, offsetAlignment};
+                return {GrSwizzle::RGBA(), GrColorType::kAlpha_8, offsetAlignment};
             } else if (srcColorType == GrColorType::kGray_8) {
-                return {GrColorType::kGray_8, offsetAlignment};
+                return {GrSwizzle::RGBA(), GrColorType::kGray_8, offsetAlignment};
             } else {
-                return {GrColorType::kUnknown, 0};
+                return {GrSwizzle(), GrColorType::kUnknown, 0};
             }
         case VK_FORMAT_B8G8R8A8_UNORM:
-            return {GrColorType::kBGRA_8888, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kBGRA_8888, offsetAlignment};
         case VK_FORMAT_R5G6B5_UNORM_PACK16:
-            return {GrColorType::kBGR_565, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kBGR_565, offsetAlignment};
         case VK_FORMAT_R16G16B16A16_SFLOAT:
             if (srcColorType == GrColorType::kRGBA_F16) {
-                return {GrColorType::kRGBA_F16, offsetAlignment};
+                return {GrSwizzle::RGBA(), GrColorType::kRGBA_F16, offsetAlignment};
             } else if (srcColorType == GrColorType::kRGBA_F16_Clamped) {
-                return {GrColorType::kRGBA_F16_Clamped, offsetAlignment};
+                return {GrSwizzle::RGBA(), GrColorType::kRGBA_F16_Clamped, offsetAlignment};
             } else {
-                return {GrColorType::kUnknown, 0};
+                return {GrSwizzle(), GrColorType::kUnknown, 0};
             }
         case VK_FORMAT_R16_SFLOAT:
-            return {GrColorType::kAlpha_F16, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kAlpha_F16, offsetAlignment};
         case VK_FORMAT_R8G8B8_UNORM:
-            return {GrColorType::kRGB_888x, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kRGB_888x, offsetAlignment};
         case VK_FORMAT_R8G8_UNORM:
-            return {GrColorType::kRG_88, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kRG_88, offsetAlignment};
         case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
-            return {GrColorType::kRGBA_1010102, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kRGBA_1010102, offsetAlignment};
         case VK_FORMAT_B4G4R4A4_UNORM_PACK16:
-            return {GrColorType::kABGR_4444, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kABGR_4444, offsetAlignment};
         case VK_FORMAT_R4G4B4A4_UNORM_PACK16:
-            return {GrColorType::kABGR_4444, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kABGR_4444, offsetAlignment};
         case VK_FORMAT_R32G32B32A32_SFLOAT:
-            return {GrColorType::kRGBA_F32, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kRGBA_F32, offsetAlignment};
         case VK_FORMAT_R8G8B8A8_SRGB:
-            return {GrColorType::kRGBA_8888_SRGB, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kRGBA_8888_SRGB, offsetAlignment};
         case VK_FORMAT_R16_UNORM:
-            return {GrColorType::kR_16, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kR_16, offsetAlignment};
         case VK_FORMAT_R16G16_UNORM:
-            return {GrColorType::kRG_1616, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kRG_1616, offsetAlignment};
         // Experimental (for Y416 and mutant P016/P010)
         case VK_FORMAT_R16G16B16A16_UNORM:
-            return {GrColorType::kRGBA_16161616, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kRGBA_16161616, offsetAlignment};
         case VK_FORMAT_R16G16_SFLOAT:
-            return {GrColorType::kRG_F16, offsetAlignment};
+            return {GrSwizzle::RGBA(), GrColorType::kRG_F16, offsetAlignment};
         default:
-            return {GrColorType::kUnknown, 0};
+            return {GrSwizzle(), GrColorType::kUnknown, 0};
     }
 }