Revert "Store GrSwizzle on proxies for texturing and swizzling."

This reverts commit 23093135d17427ef59385761d2d729ada6d961cf.

Reason for revert: Breaking Google3 :(

Original change's description:
> Store GrSwizzle on proxies for texturing and swizzling.
> 
> Bug: skia: 6718
> Change-Id: I023d7507da9334e984ac8209a32323d616b3d79d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214305
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ie2303ad090f58de07db7b0ac2d42e06e5e5bbcc1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia: 6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221338
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/gn/gpu.gni b/gn/gpu.gni
index c7535b0..8a1904d 100644
--- a/gn/gpu.gni
+++ b/gn/gpu.gni
@@ -44,7 +44,6 @@
   "$_include/private/GrResourceKey.h",
   "$_include/private/GrSingleOwner.h",
   "$_include/private/GrSurfaceProxy.h",
-  "$_include/private/GrSwizzle.h",
   "$_include/private/GrTextureProxy.h",
   "$_include/private/GrTypesPriv.h",
 
@@ -195,6 +194,7 @@
   "$_src/gpu/GrSurfaceContextPriv.h",
   "$_src/gpu/GrSurfaceProxyPriv.h",
   "$_src/gpu/GrSwizzle.cpp",
+  "$_src/gpu/GrSwizzle.h",
   "$_src/gpu/GrTessellator.cpp",
   "$_src/gpu/GrTessellator.h",
   "$_src/gpu/GrTextureOpList.cpp",
diff --git a/include/private/GrRenderTargetProxy.h b/include/private/GrRenderTargetProxy.h
index f038db6..040acea 100644
--- a/include/private/GrRenderTargetProxy.h
+++ b/include/private/GrRenderTargetProxy.h
@@ -9,7 +9,6 @@
 #define GrRenderTargetProxy_DEFINED
 
 #include "include/private/GrSurfaceProxy.h"
-#include "include/private/GrSwizzle.h"
 #include "include/private/GrTypesPriv.h"
 
 class GrResourceProvider;
@@ -55,8 +54,6 @@
 
     int maxWindowRectangles(const GrCaps& caps) const;
 
-    const GrSwizzle& outputSwizzle() const { return fOutputSwizzle; }
-
     bool wrapsVkSecondaryCB() const { return fWrapsVkSecondaryCB == WrapsVkSecondaryCB::kYes; }
 
     // TODO: move this to a priv class!
@@ -72,9 +69,7 @@
 
     // Deferred version
     GrRenderTargetProxy(const GrCaps&, const GrBackendFormat&, const GrSurfaceDesc&,
-                        GrSurfaceOrigin, const GrSwizzle& textureSwizzle,
-                        const GrSwizzle& outputSwizzle, SkBackingFit, SkBudgeted,
-                        GrInternalSurfaceFlags);
+                        GrSurfaceOrigin, SkBackingFit, SkBudgeted, GrInternalSurfaceFlags);
 
     enum class WrapsVkSecondaryCB : bool { kNo = false, kYes = true };
 
@@ -90,13 +85,11 @@
     // know the final size until flush time.
     GrRenderTargetProxy(LazyInstantiateCallback&&, LazyInstantiationType lazyType,
                         const GrBackendFormat&, const GrSurfaceDesc&, GrSurfaceOrigin,
-                        const GrSwizzle& textureSwizzle, const GrSwizzle& outputSwizzle,
                         SkBackingFit, SkBudgeted, GrInternalSurfaceFlags,
                         WrapsVkSecondaryCB wrapsVkSecondaryCB);
 
     // Wrapped version
-    GrRenderTargetProxy(sk_sp<GrSurface>, GrSurfaceOrigin, const GrSwizzle& textureSwizzle,
-                        const GrSwizzle& outputSwizzle,
+    GrRenderTargetProxy(sk_sp<GrSurface>, GrSurfaceOrigin,
                         WrapsVkSecondaryCB wrapsVkSecondaryCB = WrapsVkSecondaryCB::kNo);
 
     sk_sp<GrSurface> createSurface(GrResourceProvider*) const override;
@@ -127,15 +120,8 @@
     // address of other types, leading to this problem.
 
     int                fSampleCnt;
-    GrSwizzle          fOutputSwizzle;
     bool               fNeedsStencil;
     WrapsVkSecondaryCB fWrapsVkSecondaryCB;
-    // This is to fix issue in large comment above. Without the padding we end 6 bytes into a 16
-    // byte range, so the GrTextureProxy ends up starting 8 byte aligned by not 16. We add the
-    // padding here to get us right up to the 16 byte alignment (technically any padding of 3-10
-    // bytes would work since it always goes up to 8 byte alignment, but we use 10 to more explicit
-    // about what we're doing).
-    char               fDummyPadding[10];
 
     // For wrapped render targets the actual GrRenderTarget is stored in the GrIORefProxy class.
     // For deferred proxies that pointer is filled in when we need to instantiate the
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index 414b84b..7b938b1 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -13,7 +13,6 @@
 #include "include/gpu/GrGpuResource.h"
 #include "include/gpu/GrSurface.h"
 #include "include/gpu/GrTexture.h"
-#include "include/private/GrSwizzle.h"
 #include "include/private/SkNoncopyable.h"
 
 class GrCaps;
@@ -250,8 +249,6 @@
         return fOrigin;
     }
 
-    const GrSwizzle& textureSwizzle() const { return fTextureSwizzle; }
-
     const GrBackendFormat& backendFormat() const { return fFormat; }
 
     class UniqueID {
@@ -417,22 +414,20 @@
 protected:
     // Deferred version
     GrSurfaceProxy(const GrBackendFormat& format, const GrSurfaceDesc& desc,
-                   GrSurfaceOrigin origin, const GrSwizzle& textureSwizzle, SkBackingFit fit,
+                   GrSurfaceOrigin origin, SkBackingFit fit,
                    SkBudgeted budgeted, GrInternalSurfaceFlags surfaceFlags)
-            : GrSurfaceProxy(nullptr, LazyInstantiationType::kSingleUse, format, desc, origin,
-                             textureSwizzle, fit, budgeted, surfaceFlags) {
+            : GrSurfaceProxy(nullptr, LazyInstantiationType::kSingleUse, format, desc, origin, fit,
+                             budgeted, surfaceFlags) {
         // Note: this ctor pulls a new uniqueID from the same pool at the GrGpuResources
     }
 
     // Lazy-callback version
     GrSurfaceProxy(LazyInstantiateCallback&&, LazyInstantiationType,
                    const GrBackendFormat& format, const GrSurfaceDesc&, GrSurfaceOrigin,
-                   const GrSwizzle& textureSwizzle, SkBackingFit, SkBudgeted,
-                   GrInternalSurfaceFlags);
+                   SkBackingFit, SkBudgeted, GrInternalSurfaceFlags);
 
     // Wrapped version.
-    GrSurfaceProxy(sk_sp<GrSurface>, GrSurfaceOrigin, const GrSwizzle& textureSwizzle,
-                   SkBackingFit);
+    GrSurfaceProxy(sk_sp<GrSurface>, GrSurfaceOrigin, SkBackingFit);
 
     virtual ~GrSurfaceProxy();
 
@@ -483,8 +478,6 @@
     int                    fWidth;
     int                    fHeight;
     GrSurfaceOrigin        fOrigin;
-    GrSwizzle              fTextureSwizzle;
-
     SkBackingFit           fFit;      // always kApprox for lazy-callback resources
                                       // always kExact for wrapped resources
     mutable SkBudgeted     fBudgeted; // always kYes for lazy-callback resources
diff --git a/include/private/GrTextureProxy.h b/include/private/GrTextureProxy.h
index 7bc7528..5d136e3 100644
--- a/include/private/GrTextureProxy.h
+++ b/include/private/GrTextureProxy.h
@@ -88,10 +88,13 @@
     friend class GrTextureProxyPriv;
     friend class GrSurfaceProxyPriv;  // ability to change key sync state after lazy instantiation.
 
+    // Deferred version - when constructed with data the origin is always kTopLeft.
+    GrTextureProxy(const GrBackendFormat&, const GrSurfaceDesc& srcDesc, GrMipMapped, SkBackingFit,
+                   SkBudgeted, const void* srcData, size_t srcRowBytes, GrInternalSurfaceFlags);
+
     // Deferred version - no data.
     GrTextureProxy(const GrBackendFormat&, const GrSurfaceDesc& srcDesc, GrSurfaceOrigin,
-                   GrMipMapped, const GrSwizzle& textureSwizzle, SkBackingFit, SkBudgeted,
-                   GrInternalSurfaceFlags);
+                   GrMipMapped, SkBackingFit, SkBudgeted, GrInternalSurfaceFlags);
 
     // Lazy-callback version
     // There are two main use cases for lazily-instantiated proxies:
@@ -104,11 +107,11 @@
     // The minimal knowledge version is used for CCPR where we are generating an atlas but we do not
     // know the final size until flush time.
     GrTextureProxy(LazyInstantiateCallback&&, LazyInstantiationType, const GrBackendFormat&,
-                   const GrSurfaceDesc& desc, GrSurfaceOrigin, GrMipMapped, const GrSwizzle&,
-                   SkBackingFit, SkBudgeted, GrInternalSurfaceFlags);
+                   const GrSurfaceDesc& desc, GrSurfaceOrigin, GrMipMapped, SkBackingFit,
+                   SkBudgeted, GrInternalSurfaceFlags);
 
     // Wrapped version
-    GrTextureProxy(sk_sp<GrSurface>, GrSurfaceOrigin, const GrSwizzle&);
+    GrTextureProxy(sk_sp<GrSurface>, GrSurfaceOrigin);
 
     ~GrTextureProxy() override;
 
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 1a6962c..025273d 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -11,13 +11,13 @@
 #include "include/core/SkPath.h"
 #include "include/core/SkSurface.h"
 #include "include/gpu/GrTypes.h"
-#include "include/private/GrSwizzle.h"
 #include "include/private/SkTArray.h"
 #include "src/gpu/GrAllocator.h"
 #include "src/gpu/GrCaps.h"
 #include "src/gpu/GrGpuCommandBuffer.h"
 #include "src/gpu/GrProgramDesc.h"
 #include "src/gpu/GrSamplePatternDictionary.h"
+#include "src/gpu/GrSwizzle.h"
 #include "src/gpu/GrTextureProducer.h"
 #include "src/gpu/GrXferProcessor.h"
 #include <map>
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index 8551983..bb9ca00 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -154,15 +154,11 @@
         SkASSERT(!this->findProxyByUniqueKey(tex->getUniqueKey(), origin));
     }
 #endif
-    GrColorType colorType = GrPixelConfigToColorType(tex->config());
-    GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(tex->backendFormat(), colorType);
 
     if (tex->asRenderTarget()) {
-        GrSwizzle outSwizzle = this->caps()->getOutputSwizzle(tex->backendFormat(), colorType);
-        return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(std::move(tex), origin,
-                                                                    texSwizzle, outSwizzle));
+        return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(std::move(tex), origin));
     } else {
-        return sk_sp<GrTextureProxy>(new GrTextureProxy(std::move(tex), origin, texSwizzle));
+        return sk_sp<GrTextureProxy>(new GrTextureProxy(std::move(tex), origin));
     }
 }
 
@@ -452,20 +448,15 @@
                 this->caps()->getRenderTargetSampleCount(desc.fSampleCnt, desc.fConfig);
     }
 
-    GrColorType colorType = GrPixelConfigToColorType(desc.fConfig);
-    GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(format, colorType);
-
     if (copyDesc.fFlags & kRenderTarget_GrSurfaceFlag) {
         // We know anything we instantiate later from this deferred path will be
         // both texturable and renderable
-        GrSwizzle outSwizzle = this->caps()->getOutputSwizzle(format, colorType);
         return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(*this->caps(), format, copyDesc,
-                                                                    origin, mipMapped, texSwizzle,
-                                                                    outSwizzle, fit, budgeted,
-                                                                    surfaceFlags));
+                                                                    origin, mipMapped,
+                                                                    fit, budgeted, surfaceFlags));
     }
 
-    return sk_sp<GrTextureProxy>(new GrTextureProxy(format, copyDesc, origin, mipMapped, texSwizzle,
+    return sk_sp<GrTextureProxy>(new GrTextureProxy(format, copyDesc, origin, mipMapped,
                                                     fit, budgeted, surfaceFlags));
 }
 
@@ -544,10 +535,7 @@
     // Make sure we match how we created the proxy with SkBudgeted::kNo
     SkASSERT(GrBudgetedType::kBudgeted != tex->resourcePriv().budgetedType());
 
-    GrColorType colorType = GrPixelConfigToColorType(tex->config());
-    GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(tex->backendFormat(), colorType);
-
-    return sk_sp<GrTextureProxy>(new GrTextureProxy(std::move(tex), origin, texSwizzle));
+    return sk_sp<GrTextureProxy>(new GrTextureProxy(std::move(tex), origin));
 }
 
 sk_sp<GrTextureProxy> GrProxyProvider::wrapRenderableBackendTexture(
@@ -588,12 +576,7 @@
     // Make sure we match how we created the proxy with SkBudgeted::kNo
     SkASSERT(GrBudgetedType::kBudgeted != tex->resourcePriv().budgetedType());
 
-    GrColorType colorType = GrPixelConfigToColorType(tex->config());
-    GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(tex->backendFormat(), colorType);
-    GrSwizzle outSwizzle = this->caps()->getOutputSwizzle(tex->backendFormat(), colorType);
-
-    return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(std::move(tex), origin, texSwizzle,
-                                                                outSwizzle));
+    return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(std::move(tex), origin));
 }
 
 sk_sp<GrSurfaceProxy> GrProxyProvider::wrapBackendRenderTarget(
@@ -609,8 +592,8 @@
         return nullptr;
     }
 
-    GrColorType colorType = GrPixelConfigToColorType(backendRT.config());
 #ifdef SK_DEBUG
+    GrColorType colorType = GrPixelConfigToColorType(backendRT.config());
     GrPixelConfig testConfig =
             this->caps()->validateBackendRenderTarget(backendRT,
                                                       GrColorTypeToSkColorType(colorType));
@@ -633,11 +616,7 @@
     // Make sure we match how we created the proxy with SkBudgeted::kNo
     SkASSERT(GrBudgetedType::kBudgeted != rt->resourcePriv().budgetedType());
 
-    GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(rt->backendFormat(), colorType);
-    GrSwizzle outSwizzle = this->caps()->getOutputSwizzle(rt->backendFormat(), colorType);
-
-    return sk_sp<GrRenderTargetProxy>(new GrRenderTargetProxy(std::move(rt), origin, texSwizzle,
-                                                              outSwizzle));
+    return sk_sp<GrRenderTargetProxy>(new GrRenderTargetProxy(std::move(rt), origin));
 }
 
 sk_sp<GrSurfaceProxy> GrProxyProvider::wrapBackendTextureAsRenderTarget(
@@ -667,12 +646,7 @@
     // This proxy should be unbudgeted because we're just wrapping an external resource
     SkASSERT(GrBudgetedType::kBudgeted != rt->resourcePriv().budgetedType());
 
-    GrColorType colorType = GrPixelConfigToColorType(rt->config());
-    GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(rt->backendFormat(), colorType);
-    GrSwizzle outSwizzle = this->caps()->getOutputSwizzle(rt->backendFormat(), colorType);
-
-    return sk_sp<GrSurfaceProxy>(new GrRenderTargetProxy(std::move(rt), origin, texSwizzle,
-                                                         outSwizzle));
+    return sk_sp<GrSurfaceProxy>(new GrRenderTargetProxy(std::move(rt), origin));
 }
 
 sk_sp<GrRenderTargetProxy> GrProxyProvider::wrapVulkanSecondaryCBAsRenderTarget(
@@ -700,14 +674,10 @@
     // This proxy should be unbudgeted because we're just wrapping an external resource
     SkASSERT(GrBudgetedType::kBudgeted != rt->resourcePriv().budgetedType());
 
-    GrColorType colorType = GrPixelConfigToColorType(rt->config());
-    GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(rt->backendFormat(), colorType);
-    GrSwizzle outSwizzle = this->caps()->getOutputSwizzle(rt->backendFormat(), colorType);
-
     // All Vulkan surfaces uses top left origins.
     return sk_sp<GrRenderTargetProxy>(
             new GrRenderTargetProxy(std::move(rt),
-                                    kTopLeft_GrSurfaceOrigin, texSwizzle, outSwizzle,
+                                    kTopLeft_GrSurfaceOrigin,
                                     GrRenderTargetProxy::WrapsVkSecondaryCB::kYes));
 }
 
@@ -764,17 +734,12 @@
     }
 #endif
 
-    GrColorType colorType = GrPixelConfigToColorType(desc.fConfig);
-    GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(format, colorType);
-    GrSwizzle outSwizzle = this->caps()->getOutputSwizzle(format, colorType);
-
     return sk_sp<GrTextureProxy>(
             SkToBool(kRenderTarget_GrSurfaceFlag & desc.fFlags)
                     ? new GrTextureRenderTargetProxy(std::move(callback), lazyType, format, desc,
-                                                     origin, mipMapped, texSwizzle, outSwizzle, fit,
-                                                     budgeted, surfaceFlags)
+                                                     origin, mipMapped, fit, budgeted, surfaceFlags)
                     : new GrTextureProxy(std::move(callback), lazyType, format, desc, origin,
-                                         mipMapped, texSwizzle, fit, budgeted, surfaceFlags));
+                                         mipMapped, fit, budgeted, surfaceFlags));
 }
 
 sk_sp<GrRenderTargetProxy> GrProxyProvider::createLazyRenderTargetProxy(
@@ -804,17 +769,13 @@
     LazyInstantiationType lazyType = this->renderingDirectly() ? LazyInstantiationType::kSingleUse
                                                                : LazyInstantiationType::kMultipleUse;
 
-    GrColorType colorType = GrPixelConfigToColorType(desc.fConfig);
-    GrSwizzle texSwizzle = this->caps()->getTextureSwizzle(format, colorType);
-    GrSwizzle outSwizzle = this->caps()->getOutputSwizzle(format, colorType);
-
     if (textureInfo) {
         // Wrapped vulkan secondary command buffers don't support texturing since we won't have an
         // actual VkImage to texture from.
         SkASSERT(!wrapsVkSecondaryCB);
         return sk_sp<GrRenderTargetProxy>(new GrTextureRenderTargetProxy(
                 std::move(callback), lazyType, format, desc, origin, textureInfo->fMipMapped,
-                texSwizzle, outSwizzle, fit, budgeted, surfaceFlags));
+                fit, budgeted, surfaceFlags));
     }
 
     GrRenderTargetProxy::WrapsVkSecondaryCB vkSCB =
@@ -822,8 +783,8 @@
                                : GrRenderTargetProxy::WrapsVkSecondaryCB::kNo;
 
     return sk_sp<GrRenderTargetProxy>(new GrRenderTargetProxy(
-            std::move(callback), lazyType, format, desc, origin, texSwizzle, outSwizzle, fit,
-            budgeted, surfaceFlags, vkSCB));
+            std::move(callback), lazyType, format, desc, origin, fit, budgeted, surfaceFlags,
+            vkSCB));
 }
 
 sk_sp<GrTextureProxy> GrProxyProvider::MakeFullyLazyProxy(
@@ -843,18 +804,14 @@
     desc.fConfig = config;
     desc.fSampleCnt = sampleCnt;
 
-    GrColorType colorType = GrPixelConfigToColorType(desc.fConfig);
-    GrSwizzle texSwizzle = caps.getTextureSwizzle(format, colorType);
-    GrSwizzle outSwizzle = caps.getOutputSwizzle(format, colorType);
-
     return sk_sp<GrTextureProxy>(
             (Renderable::kYes == renderable)
                     ? new GrTextureRenderTargetProxy(
                               std::move(callback), LazyInstantiationType::kSingleUse, format, desc,
-                              origin, GrMipMapped::kNo, texSwizzle, outSwizzle,
-                              SkBackingFit::kApprox, SkBudgeted::kYes, surfaceFlags)
+                              origin, GrMipMapped::kNo, SkBackingFit::kApprox, SkBudgeted::kYes,
+                              surfaceFlags)
                     : new GrTextureProxy(std::move(callback), LazyInstantiationType::kSingleUse,
-                                         format, desc, origin, GrMipMapped::kNo, texSwizzle,
+                                         format, desc, origin, GrMipMapped::kNo,
                                          SkBackingFit::kApprox, SkBudgeted::kYes, surfaceFlags));
 }
 
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp
index c90ff98..bd453c8 100644
--- a/src/gpu/GrRenderTargetProxy.cpp
+++ b/src/gpu/GrRenderTargetProxy.cpp
@@ -21,12 +21,10 @@
 // cases to make the sampleConfig/numSamples stuff more rational.
 GrRenderTargetProxy::GrRenderTargetProxy(const GrCaps& caps, const GrBackendFormat& format,
                                          const GrSurfaceDesc& desc, GrSurfaceOrigin origin,
-                                         const GrSwizzle& textureSwizzle,
-                                         const GrSwizzle& outputSwizzle, SkBackingFit fit,
-                                         SkBudgeted budgeted, GrInternalSurfaceFlags surfaceFlags)
-        : INHERITED(format, desc, origin, textureSwizzle, fit, budgeted, surfaceFlags)
+                                         SkBackingFit fit, SkBudgeted budgeted,
+                                         GrInternalSurfaceFlags surfaceFlags)
+        : INHERITED(format, desc, origin, fit, budgeted, surfaceFlags)
         , fSampleCnt(desc.fSampleCnt)
-        , fOutputSwizzle(outputSwizzle)
         , fNeedsStencil(false)
         , fWrapsVkSecondaryCB(WrapsVkSecondaryCB::kNo) {
     // Since we know the newly created render target will be internal, we are able to precompute
@@ -40,14 +38,12 @@
 GrRenderTargetProxy::GrRenderTargetProxy(LazyInstantiateCallback&& callback,
                                          LazyInstantiationType lazyType,
                                          const GrBackendFormat& format, const GrSurfaceDesc& desc,
-                                         GrSurfaceOrigin origin, const GrSwizzle& textureSwizzle,
-                                         const GrSwizzle& outputSwizzle, SkBackingFit fit,
+                                         GrSurfaceOrigin origin,  SkBackingFit fit,
                                          SkBudgeted budgeted, GrInternalSurfaceFlags surfaceFlags,
                                          WrapsVkSecondaryCB wrapsVkSecondaryCB)
-        : INHERITED(std::move(callback), lazyType, format, desc, origin, textureSwizzle, fit,
-                    budgeted, surfaceFlags)
+        : INHERITED(std::move(callback), lazyType, format, desc, origin, fit, budgeted,
+                    surfaceFlags)
         , fSampleCnt(desc.fSampleCnt)
-        , fOutputSwizzle(outputSwizzle)
         , fNeedsStencil(false)
         , fWrapsVkSecondaryCB(wrapsVkSecondaryCB) {
     SkASSERT(SkToBool(kRenderTarget_GrSurfaceFlag & desc.fFlags));
@@ -55,12 +51,9 @@
 
 // Wrapped version
 GrRenderTargetProxy::GrRenderTargetProxy(sk_sp<GrSurface> surf, GrSurfaceOrigin origin,
-                                         const GrSwizzle& textureSwizzle,
-                                         const GrSwizzle& outputSwizzle,
                                          WrapsVkSecondaryCB wrapsVkSecondaryCB)
-        : INHERITED(std::move(surf), origin, textureSwizzle, SkBackingFit::kExact)
+        : INHERITED(std::move(surf), origin, SkBackingFit::kExact)
         , fSampleCnt(fTarget->asRenderTarget()->numStencilSamples())
-        , fOutputSwizzle(outputSwizzle)
         , fNeedsStencil(false)
         , fWrapsVkSecondaryCB(wrapsVkSecondaryCB) {
 }
diff --git a/src/gpu/GrShaderCaps.h b/src/gpu/GrShaderCaps.h
index cf9005a..53af67d 100644
--- a/src/gpu/GrShaderCaps.h
+++ b/src/gpu/GrShaderCaps.h
@@ -9,8 +9,8 @@
 #define GrShaderCaps_DEFINED
 
 #include "include/core/SkRefCnt.h"
-#include "include/private/GrSwizzle.h"
 #include "include/private/GrTypesPriv.h"
+#include "src/gpu/GrSwizzle.h"
 #include "src/gpu/glsl/GrGLSL.h"
 
 namespace SkSL {
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index a2408e5..ccf2e55 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -54,16 +54,14 @@
 // Lazy-callback version
 GrSurfaceProxy::GrSurfaceProxy(LazyInstantiateCallback&& callback, LazyInstantiationType lazyType,
                                const GrBackendFormat& format, const GrSurfaceDesc& desc,
-                               GrSurfaceOrigin origin, const GrSwizzle& textureSwizzle,
-                               SkBackingFit fit, SkBudgeted budgeted,
-                               GrInternalSurfaceFlags surfaceFlags)
+                               GrSurfaceOrigin origin, SkBackingFit fit,
+                               SkBudgeted budgeted, GrInternalSurfaceFlags surfaceFlags)
         : fSurfaceFlags(surfaceFlags)
         , fFormat(format)
         , fConfig(desc.fConfig)
         , fWidth(desc.fWidth)
         , fHeight(desc.fHeight)
         , fOrigin(origin)
-        , fTextureSwizzle(textureSwizzle)
         , fFit(fit)
         , fBudgeted(budgeted)
         , fLazyInstantiateCallback(std::move(callback))
@@ -86,8 +84,7 @@
 }
 
 // Wrapped version
-GrSurfaceProxy::GrSurfaceProxy(sk_sp<GrSurface> surface, GrSurfaceOrigin origin,
-                               const GrSwizzle& textureSwizzle, SkBackingFit fit)
+GrSurfaceProxy::GrSurfaceProxy(sk_sp<GrSurface> surface, GrSurfaceOrigin origin, SkBackingFit fit)
         : INHERITED(std::move(surface))
         , fSurfaceFlags(fTarget->surfacePriv().flags())
         , fFormat(fTarget->backendFormat())
@@ -95,7 +92,6 @@
         , fWidth(fTarget->width())
         , fHeight(fTarget->height())
         , fOrigin(origin)
-        , fTextureSwizzle(textureSwizzle)
         , fFit(fit)
         , fBudgeted(fTarget->resourcePriv().budgetedType() == GrBudgetedType::kBudgeted
                             ? SkBudgeted::kYes
diff --git a/src/gpu/GrSwizzle.cpp b/src/gpu/GrSwizzle.cpp
index b720409..21fe834 100644
--- a/src/gpu/GrSwizzle.cpp
+++ b/src/gpu/GrSwizzle.cpp
@@ -5,7 +5,7 @@
  * found in the LICENSE file.
  */
 
-#include "include/private/GrSwizzle.h"
+#include "src/gpu/GrSwizzle.h"
 #include "src/core/SkRasterPipeline.h"
 
 void GrSwizzle::apply(SkRasterPipeline* pipeline) const {
diff --git a/include/private/GrSwizzle.h b/src/gpu/GrSwizzle.h
similarity index 100%
rename from include/private/GrSwizzle.h
rename to src/gpu/GrSwizzle.h
diff --git a/src/gpu/GrTextureProxy.cpp b/src/gpu/GrTextureProxy.cpp
index 3a39481..e0c0b47 100644
--- a/src/gpu/GrTextureProxy.cpp
+++ b/src/gpu/GrTextureProxy.cpp
@@ -15,12 +15,24 @@
 #include "src/gpu/GrSurfacePriv.h"
 #include "src/gpu/GrTexturePriv.h"
 
+// Deferred version - with data
+GrTextureProxy::GrTextureProxy(const GrBackendFormat& format, const GrSurfaceDesc& srcDesc,
+                               GrMipMapped mipMapped, SkBackingFit fit, SkBudgeted budgeted,
+                               const void* srcData, size_t /*rowBytes*/,
+                               GrInternalSurfaceFlags surfaceFlags)
+        : INHERITED(format, srcDesc, kTopLeft_GrSurfaceOrigin, fit, budgeted, surfaceFlags)
+        , fMipMapped(mipMapped)
+        , fProxyProvider(nullptr)
+        , fDeferredUploader(nullptr) {
+    SkASSERT(!srcData);  // currently handled in Make()
+}
+
 // Deferred version - no data
 GrTextureProxy::GrTextureProxy(const GrBackendFormat& format, const GrSurfaceDesc& srcDesc,
                                GrSurfaceOrigin origin, GrMipMapped mipMapped,
-                               const GrSwizzle& textureSwizzle, SkBackingFit fit,
-                               SkBudgeted budgeted, GrInternalSurfaceFlags surfaceFlags)
-        : INHERITED(format, srcDesc, origin, textureSwizzle, fit, budgeted, surfaceFlags)
+                               SkBackingFit fit, SkBudgeted budgeted,
+                               GrInternalSurfaceFlags surfaceFlags)
+        : INHERITED(format, srcDesc, origin, fit, budgeted, surfaceFlags)
         , fMipMapped(mipMapped)
         , fProxyProvider(nullptr)
         , fDeferredUploader(nullptr) {}
@@ -28,19 +40,17 @@
 // Lazy-callback version
 GrTextureProxy::GrTextureProxy(LazyInstantiateCallback&& callback, LazyInstantiationType lazyType,
                                const GrBackendFormat& format, const GrSurfaceDesc& desc,
-                               GrSurfaceOrigin origin, GrMipMapped mipMapped,
-                               const GrSwizzle& texSwizzle, SkBackingFit fit, SkBudgeted budgeted,
-                               GrInternalSurfaceFlags surfaceFlags)
-        : INHERITED(std::move(callback), lazyType, format, desc, origin, texSwizzle, fit, budgeted,
+                               GrSurfaceOrigin origin, GrMipMapped mipMapped, SkBackingFit fit,
+                               SkBudgeted budgeted, GrInternalSurfaceFlags surfaceFlags)
+        : INHERITED(std::move(callback), lazyType, format, desc, origin, fit, budgeted,
                     surfaceFlags)
         , fMipMapped(mipMapped)
         , fProxyProvider(nullptr)
         , fDeferredUploader(nullptr) {}
 
 // Wrapped version
-GrTextureProxy::GrTextureProxy(sk_sp<GrSurface> surf, GrSurfaceOrigin origin,
-                               const GrSwizzle& textureSwizzle)
-        : INHERITED(std::move(surf), origin, textureSwizzle, SkBackingFit::kExact)
+GrTextureProxy::GrTextureProxy(sk_sp<GrSurface> surf, GrSurfaceOrigin origin)
+        : INHERITED(std::move(surf), origin, SkBackingFit::kExact)
         , fMipMapped(fTarget->asTexture()->texturePriv().mipMapped())
         , fProxyProvider(nullptr)
         , fDeferredUploader(nullptr) {
diff --git a/src/gpu/GrTextureRenderTargetProxy.cpp b/src/gpu/GrTextureRenderTargetProxy.cpp
index 8366e75..7bf9002 100644
--- a/src/gpu/GrTextureRenderTargetProxy.cpp
+++ b/src/gpu/GrTextureRenderTargetProxy.cpp
@@ -23,17 +23,13 @@
                                                        const GrSurfaceDesc& desc,
                                                        GrSurfaceOrigin origin,
                                                        GrMipMapped mipMapped,
-                                                       const GrSwizzle& texSwizzle,
-                                                       const GrSwizzle& outSwizzle,
                                                        SkBackingFit fit,
                                                        SkBudgeted budgeted,
                                                        GrInternalSurfaceFlags surfaceFlags)
-        : GrSurfaceProxy(format, desc, origin, texSwizzle, fit, budgeted, surfaceFlags)
+        : GrSurfaceProxy(format, desc, origin, fit, budgeted, surfaceFlags)
         // for now textures w/ data are always wrapped
-        , GrRenderTargetProxy(caps, format, desc, origin, texSwizzle, outSwizzle, fit, budgeted,
-                              surfaceFlags)
-        , GrTextureProxy(format, desc, origin, mipMapped, texSwizzle, fit, budgeted, surfaceFlags) {
-}
+        , GrRenderTargetProxy(caps, format, desc, origin, fit, budgeted, surfaceFlags)
+        , GrTextureProxy(format, desc, origin, mipMapped, fit, budgeted, surfaceFlags) {}
 
 // Lazy-callback version
 GrTextureRenderTargetProxy::GrTextureRenderTargetProxy(LazyInstantiateCallback&& callback,
@@ -42,30 +38,26 @@
                                                        const GrSurfaceDesc& desc,
                                                        GrSurfaceOrigin origin,
                                                        GrMipMapped mipMapped,
-                                                       const GrSwizzle& texSwizzle,
-                                                       const GrSwizzle& outSwizzle,
                                                        SkBackingFit fit,
                                                        SkBudgeted budgeted,
                                                        GrInternalSurfaceFlags surfaceFlags)
-        : GrSurfaceProxy(std::move(callback), lazyType, format, desc, origin, texSwizzle, fit,
-                         budgeted, surfaceFlags)
+        : GrSurfaceProxy(std::move(callback), lazyType, format, desc, origin, fit, budgeted,
+                         surfaceFlags)
         // Since we have virtual inheritance, we initialize GrSurfaceProxy directly. Send null
         // callbacks to the texture and RT proxies simply to route to the appropriate constructors.
-        , GrRenderTargetProxy(LazyInstantiateCallback(), lazyType, format, desc, origin, texSwizzle,
-                              outSwizzle, fit, budgeted, surfaceFlags, WrapsVkSecondaryCB::kNo)
+        , GrRenderTargetProxy(LazyInstantiateCallback(), lazyType, format, desc, origin, fit,
+                              budgeted, surfaceFlags, WrapsVkSecondaryCB::kNo)
         , GrTextureProxy(LazyInstantiateCallback(), lazyType, format, desc, origin, mipMapped,
-                         texSwizzle, fit, budgeted, surfaceFlags) {}
+                         fit, budgeted, surfaceFlags) {}
 
 // Wrapped version
 // This class is virtually derived from GrSurfaceProxy (via both GrTextureProxy and
 // GrRenderTargetProxy) so its constructor must be explicitly called.
 GrTextureRenderTargetProxy::GrTextureRenderTargetProxy(sk_sp<GrSurface> surf,
-                                                       GrSurfaceOrigin origin,
-                                                       const GrSwizzle& texSwizzle,
-                                                       const GrSwizzle& outSwizzle)
-        : GrSurfaceProxy(surf, origin, texSwizzle, SkBackingFit::kExact)
-        , GrRenderTargetProxy(surf, origin, texSwizzle, outSwizzle)
-        , GrTextureProxy(surf, origin, texSwizzle) {
+                                                       GrSurfaceOrigin origin)
+        : GrSurfaceProxy(surf, origin, SkBackingFit::kExact)
+        , GrRenderTargetProxy(surf, origin)
+        , GrTextureProxy(surf, origin) {
     SkASSERT(surf->asTexture());
     SkASSERT(surf->asRenderTarget());
 }
diff --git a/src/gpu/GrTextureRenderTargetProxy.h b/src/gpu/GrTextureRenderTargetProxy.h
index 1afd456..852309b 100644
--- a/src/gpu/GrTextureRenderTargetProxy.h
+++ b/src/gpu/GrTextureRenderTargetProxy.h
@@ -29,20 +29,16 @@
 
     // Deferred version
     GrTextureRenderTargetProxy(const GrCaps&, const GrBackendFormat&, const GrSurfaceDesc&,
-                               GrSurfaceOrigin, GrMipMapped, const GrSwizzle& textureSwizzle,
-                               const GrSwizzle& outputSwizzle, SkBackingFit, SkBudgeted,
+                               GrSurfaceOrigin, GrMipMapped, SkBackingFit, SkBudgeted,
                                GrInternalSurfaceFlags);
 
     // Lazy-callback version
     GrTextureRenderTargetProxy(LazyInstantiateCallback&&, LazyInstantiationType,
                                const GrBackendFormat&, const GrSurfaceDesc& desc, GrSurfaceOrigin,
-                               GrMipMapped, const GrSwizzle& textureSwizzle,
-                               const GrSwizzle& outputSwizzle, SkBackingFit, SkBudgeted,
-                               GrInternalSurfaceFlags);
+                               GrMipMapped, SkBackingFit, SkBudgeted, GrInternalSurfaceFlags);
 
     // Wrapped version
-    GrTextureRenderTargetProxy(sk_sp<GrSurface>, GrSurfaceOrigin, const GrSwizzle& textureSwizzle,
-                               const GrSwizzle& outputSwizzle);
+    GrTextureRenderTargetProxy(sk_sp<GrSurface>, GrSurfaceOrigin);
 
     bool instantiate(GrResourceProvider*) override;
     sk_sp<GrSurface> createSurface(GrResourceProvider*) const override;
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 87d9043..fe1a9f2 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -10,11 +10,11 @@
 #define GrGLCaps_DEFINED
 
 #include <functional>
-#include "include/private/GrSwizzle.h"
 #include "include/private/SkChecksum.h"
 #include "include/private/SkTArray.h"
 #include "include/private/SkTHash.h"
 #include "src/gpu/GrCaps.h"
+#include "src/gpu/GrSwizzle.h"
 #include "src/gpu/gl/GrGLStencilAttachment.h"
 
 class GrGLContextInfo;
diff --git a/src/gpu/gl/GrGLTypesPriv.cpp b/src/gpu/gl/GrGLTypesPriv.cpp
index 65a7608..8c66fa5 100644
--- a/src/gpu/gl/GrGLTypesPriv.cpp
+++ b/src/gpu/gl/GrGLTypesPriv.cpp
@@ -7,7 +7,7 @@
 
 #include "include/core/SkScalar.h"
 #include "include/private/GrGLTypesPriv.h"
-#include "include/private/GrSwizzle.h"
+#include "src/gpu/GrSwizzle.h"
 #include "src/gpu/gl/GrGLDefines.h"
 
 GrGLTextureParameters::SamplerOverriddenState::SamplerOverriddenState()
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index dc2afe7..bed69a3 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -8,7 +8,6 @@
 #include "src/gpu/gl/builders/GrGLProgramBuilder.h"
 
 #include "include/gpu/GrContext.h"
-#include "include/private/GrSwizzle.h"
 #include "src/core/SkATrace.h"
 #include "src/core/SkAutoMalloc.h"
 #include "src/core/SkReader32.h"
@@ -21,6 +20,7 @@
 #include "src/gpu/GrProgramDesc.h"
 #include "src/gpu/GrShaderCaps.h"
 #include "src/gpu/GrShaderUtils.h"
+#include "src/gpu/GrSwizzle.h"
 #include "src/gpu/gl/GrGLGpu.h"
 #include "src/gpu/gl/GrGLProgram.h"
 #include "src/gpu/gl/builders/GrGLProgramBuilder.h"
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
index 5a82058..bd30080 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
@@ -5,13 +5,12 @@
  * found in the LICENSE file.
  */
 
-#include "src/gpu/glsl/GrGLSLShaderBuilder.h"
-
-#include "include/private/GrSwizzle.h"
 #include "src/gpu/GrShaderCaps.h"
 #include "src/gpu/GrShaderVar.h"
+#include "src/gpu/GrSwizzle.h"
 #include "src/gpu/glsl/GrGLSLColorSpaceXformHelper.h"
 #include "src/gpu/glsl/GrGLSLProgramBuilder.h"
+#include "src/gpu/glsl/GrGLSLShaderBuilder.h"
 
 GrGLSLShaderBuilder::GrGLSLShaderBuilder(GrGLSLProgramBuilder* program)
     : fProgramBuilder(program)
diff --git a/src/gpu/glsl/GrGLSLUniformHandler.h b/src/gpu/glsl/GrGLSLUniformHandler.h
index cee6a5a..1a5c951 100644
--- a/src/gpu/glsl/GrGLSLUniformHandler.h
+++ b/src/gpu/glsl/GrGLSLUniformHandler.h
@@ -8,8 +8,8 @@
 #ifndef GrGLSLUniformHandler_DEFINED
 #define GrGLSLUniformHandler_DEFINED
 
-#include "include/private/GrSwizzle.h"
 #include "src/gpu/GrShaderVar.h"
+#include "src/gpu/GrSwizzle.h"
 #include "src/gpu/glsl/GrGLSLProgramDataManager.h"
 
 // variable names beginning with this prefix will not be mangled
diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm
index bdebe19..da2e374 100644
--- a/src/gpu/mtl/GrMtlCaps.mm
+++ b/src/gpu/mtl/GrMtlCaps.mm
@@ -657,7 +657,7 @@
 static GrSwizzle get_swizzle(const GrBackendFormat& format, GrColorType colorType,
                              bool forOutput) {
     SkASSERT(format.getMtlFormat());
-    MTLPixelFormat mtlFormat = static_cast<MTLPixelFormat>(*format.getMtlFormat());
+    MTLPixelFormat mtlFormat = static_cast<MTLPixelFormat>(*format.getVkFormat());
 
     SkASSERT(format_color_type_valid_pair(mtlFormat, colorType));
 
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 3798eb9..5db4d45 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -682,7 +682,7 @@
     }
 }
 
-// These are all the valid VkFormats that we support in Skia. They are roughly ordered from most
+// These are all the valid VkFormats that we support in Skia. They are roughly order from most
 // frequently used to least to improve look up times in arrays.
 static constexpr VkFormat kVkFormats[] = {
     VK_FORMAT_R8G8B8A8_UNORM,
diff --git a/tests/SkRasterPipelineTest.cpp b/tests/SkRasterPipelineTest.cpp
index 0124465..ce4fcf4 100644
--- a/tests/SkRasterPipelineTest.cpp
+++ b/tests/SkRasterPipelineTest.cpp
@@ -5,10 +5,10 @@
  * found in the LICENSE file.
  */
 
-#include "include/private/GrSwizzle.h"
 #include "include/private/SkHalf.h"
 #include "include/private/SkTo.h"
 #include "src/core/SkRasterPipeline.h"
+#include "src/gpu/GrSwizzle.h"
 #include "tests/Test.h"
 
 DEF_TEST(SkRasterPipeline, r) {