Dest color space no longer impacts mipmaps or texture sampling

PS5: Removes SkDestinationSurfaceColorMode, tracking of mipmap
mode on GrTexture, sRGB decode state per-texture. Because we
were often choosing sRGB configs for RGB color types, legacy
rendering would then be incorrect (too dark). So...

PS7: Stops ever using sRGB pixel configs when translating
image info or color type. Also removes a bunch of GrCaps bits
and a GrContextOption that are no longer relevant.

PS9: Adjusts surface creation unit test expectations, and
changes the raster rules accordingly.

At this point, sRGB configs are (obviously) going to be broken.

Locally, I ran 8888, gl, and the gbr- versions of both. Across
all GMs x configs, there are 13 diffs. 12 are GMs that create
surfaces with a color-space attached (and thus, the offscreen
is no longer getting sRGB pixel config). The only remainder
constructs an SkPictureImageGenerator, (with an attached color
space) and renders it to the gbr-gl canvas, which triggers a
a tagged surface inside the generator.

Bug: skia:
Change-Id: Ie5edfa157dd799f3121e8173fc4f97f6c8ed6789
Reviewed-on: https://skia-review.googlesource.com/131282
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrBitmapTextureMaker.cpp b/src/gpu/GrBitmapTextureMaker.cpp
index 2fd8016..d2a1fbe 100644
--- a/src/gpu/GrBitmapTextureMaker.cpp
+++ b/src/gpu/GrBitmapTextureMaker.cpp
@@ -49,10 +49,10 @@
 
     if (!proxy) {
         if (willBeMipped) {
-            proxy = proxyProvider->createMipMapProxyFromBitmap(fBitmap, dstColorSpace);
+            proxy = proxyProvider->createMipMapProxyFromBitmap(fBitmap);
         }
         if (!proxy) {
-            proxy = GrUploadBitmapToTextureProxy(proxyProvider, fBitmap, dstColorSpace);
+            proxy = GrUploadBitmapToTextureProxy(proxyProvider, fBitmap);
         }
         if (proxy) {
             if (fOriginalKey.isValid()) {
diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp
index 42d3d4c..db4681a 100644
--- a/src/gpu/GrCaps.cpp
+++ b/src/gpu/GrCaps.cpp
@@ -44,7 +44,6 @@
     fNPOTTextureTileSupport = false;
     fSRGBSupport = false;
     fSRGBWriteControl = false;
-    fSRGBDecodeDisableSupport = false;
     fDiscardRenderTargetSupport = false;
     fReuseScratchTextures = true;
     fReuseScratchBuffers = true;
@@ -156,7 +155,6 @@
     writer->appendBool("NPOT Texture Tile Support", fNPOTTextureTileSupport);
     writer->appendBool("sRGB Support", fSRGBSupport);
     writer->appendBool("sRGB Write Control", fSRGBWriteControl);
-    writer->appendBool("sRGB Decode Disable", fSRGBDecodeDisableSupport);
     writer->appendBool("Discard Render Target Support", fDiscardRenderTargetSupport);
     writer->appendBool("Reuse Scratch Textures", fReuseScratchTextures);
     writer->appendBool("Reuse Scratch Buffers", fReuseScratchBuffers);
diff --git a/src/gpu/GrCaps.h b/src/gpu/GrCaps.h
index b6758d1..a04699f 100644
--- a/src/gpu/GrCaps.h
+++ b/src/gpu/GrCaps.h
@@ -51,7 +51,6 @@
      * Is there support for enabling/disabling sRGB writes for sRGB-capable color buffers?
      */
     bool srgbWriteControl() const { return fSRGBWriteControl; }
-    bool srgbDecodeDisableSupport() const { return fSRGBDecodeDisableSupport; }
     bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport; }
     bool gpuTracingSupport() const { return fGpuTracingSupport; }
     bool oversizedStencilSupport() const { return fOversizedStencilSupport; }
@@ -287,7 +286,6 @@
     bool fMipMapSupport                              : 1;
     bool fSRGBSupport                                : 1;
     bool fSRGBWriteControl                           : 1;
-    bool fSRGBDecodeDisableSupport                   : 1;
     bool fDiscardRenderTargetSupport                 : 1;
     bool fReuseScratchTextures                       : 1;
     bool fReuseScratchBuffers                        : 1;
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index c9c476f..b020729 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -329,12 +329,12 @@
 int GrContext::maxRenderTargetSize() const { return fCaps->maxRenderTargetSize(); }
 
 bool GrContext::colorTypeSupportedAsImage(SkColorType colorType) const {
-    GrPixelConfig config = SkImageInfo2GrPixelConfig(colorType, nullptr, *fCaps);
+    GrPixelConfig config = SkColorType2GrPixelConfig(colorType);
     return fCaps->isConfigTexturable(config);
 }
 
 int GrContext::maxSurfaceSampleCountForColorType(SkColorType colorType) const {
-    GrPixelConfig config = SkImageInfo2GrPixelConfig(colorType, nullptr, *fCaps);
+    GrPixelConfig config = SkColorType2GrPixelConfig(colorType);
     return fCaps->maxRenderTargetSampleCount(config);
 }
 
@@ -654,8 +654,6 @@
         GrPaint paint;
         paint.addColorFragmentProcessor(std::move(fp));
         paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
-        paint.setAllowSRGBInputs(dst->colorSpaceInfo().isGammaCorrect() ||
-                                 GrPixelConfigIsSRGB(dst->colorSpaceInfo().config()));
         SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
         renderTargetContext->drawRect(GrNoClip(), std::move(paint), GrAA::kNo, matrix, rect,
                                         nullptr);
@@ -814,7 +812,6 @@
             GrPaint paint;
             paint.addColorFragmentProcessor(std::move(fp));
             paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
-            paint.setAllowSRGBInputs(true);
             SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
             tempRTC->drawRect(GrNoClip(), std::move(paint), GrAA::kNo, SkMatrix::I(), rect,
                                 nullptr);
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index eb969e4..31870dc 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -454,8 +454,7 @@
         only to be used for testing (particularly for testing the methods that import an externally
         created texture into Skia. Must be matched with a call to deleteTestingOnlyTexture(). */
     GrBackendTexture createTestingOnlyBackendTexture(const void* pixels, int w, int h, SkColorType,
-                                                     SkColorSpace* cs, bool isRenderTarget,
-                                                     GrMipMapped);
+                                                     bool isRenderTarget, GrMipMapped);
     /** Older version based on GrPixelConfig. Currently the preferred one above devolves to this. */
     virtual GrBackendTexture createTestingOnlyBackendTexture(const void* pixels, int w, int h,
                                                              GrPixelConfig config,
diff --git a/src/gpu/GrPaint.cpp b/src/gpu/GrPaint.cpp
index e29c464..bf198a8 100644
--- a/src/gpu/GrPaint.cpp
+++ b/src/gpu/GrPaint.cpp
@@ -16,7 +16,6 @@
         , fColorFragmentProcessors(that.fColorFragmentProcessors.count())
         , fCoverageFragmentProcessors(that.fCoverageFragmentProcessors.count())
         , fDisableOutputConversionToSRGB(that.fDisableOutputConversionToSRGB)
-        , fAllowSRGBInputs(that.fAllowSRGBInputs)
         , fTrivial(that.fTrivial)
         , fColor(that.fColor) {
     for (int i = 0; i < that.fColorFragmentProcessors.count(); ++i) {
diff --git a/src/gpu/GrPaint.h b/src/gpu/GrPaint.h
index c5b4563..3a5fa11 100644
--- a/src/gpu/GrPaint.h
+++ b/src/gpu/GrPaint.h
@@ -63,19 +63,11 @@
     bool getDisableOutputConversionToSRGB() const { return fDisableOutputConversionToSRGB; }
 
     /**
-     * Should sRGB inputs be allowed to perform sRGB to linear conversion. With this flag
-     * set to false, sRGB textures will be treated as linear (including filtering).
-     */
-    void setAllowSRGBInputs(bool allowSRGBInputs) { fAllowSRGBInputs = allowSRGBInputs; }
-    bool getAllowSRGBInputs() const { return fAllowSRGBInputs; }
-
-    /**
      * Should rendering be gamma-correct, end-to-end. Causes sRGB render targets to behave
-     * as such (with linear blending), and sRGB inputs to be filtered and decoded correctly.
+     * as such (with linear blending).
      */
     void setGammaCorrect(bool gammaCorrect) {
         this->setDisableOutputConversionToSRGB(!gammaCorrect);
-        this->setAllowSRGBInputs(gammaCorrect);
     }
 
     void setXPFactory(const GrXPFactory* xpFactory) {
@@ -155,7 +147,6 @@
     SkSTArray<4, std::unique_ptr<GrFragmentProcessor>> fColorFragmentProcessors;
     SkSTArray<2, std::unique_ptr<GrFragmentProcessor>> fCoverageFragmentProcessors;
     bool fDisableOutputConversionToSRGB = false;
-    bool fAllowSRGBInputs = false;
     bool fTrivial = true;
     GrColor4f fColor = GrColor4f::OpaqueWhite();
 };
diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h
index c431995..3862ab4 100644
--- a/src/gpu/GrPipeline.h
+++ b/src/gpu/GrPipeline.h
@@ -54,15 +54,10 @@
         kSnapVerticesToPixelCenters_Flag = 0x2,
         /** Disables conversion to sRGB from linear when writing to a sRGB destination. */
         kDisableOutputConversionToSRGB_Flag = 0x4,
-        /** Allows conversion from sRGB to linear when reading from processor's sRGB texture. */
-        kAllowSRGBInputs_Flag = 0x8,
     };
 
     static uint32_t SRGBFlagsFromPaint(const GrPaint& paint) {
         uint32_t flags = 0;
-        if (paint.getAllowSRGBInputs()) {
-            flags |= kAllowSRGBInputs_Flag;
-        }
         if (paint.getDisableOutputConversionToSRGB()) {
             flags |= kDisableOutputConversionToSRGB_Flag;
         }
@@ -185,9 +180,6 @@
     bool getDisableOutputConversionToSRGB() const {
         return SkToBool(fFlags & kDisableOutputConversionToSRGB_Flag);
     }
-    bool getAllowSRGBInputs() const {
-        return SkToBool(fFlags & kAllowSRGBInputs_Flag);
-    }
     bool hasStencilClip() const {
         return SkToBool(fFlags & kHasStencilClip_Flag);
     }
@@ -210,9 +202,6 @@
             if (flags & GrPipeline::kDisableOutputConversionToSRGB_Flag) {
                 result.append("Disable output conversion to sRGB.\n");
             }
-            if (flags & GrPipeline::kAllowSRGBInputs_Flag) {
-                result.append("Allow sRGB Inputs.\n");
-            }
             return result;
         }
         return SkString("No pipeline flags\n");
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index 49e57df3..a2b97d1 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -211,8 +211,7 @@
         return nullptr;
     }
 
-    GrPixelConfig config = SkImageInfo2GrPixelConfig(as_IB(srcImage)->onImageInfo(),
-                                                     *this->caps());
+    GrPixelConfig config = SkImageInfo2GrPixelConfig(as_IB(srcImage)->onImageInfo());
 
     if (kUnknown_GrPixelConfig == config) {
         return nullptr;
@@ -284,13 +283,8 @@
                              GrInternalSurfaceFlags::kNone);
 }
 
-sk_sp<GrTextureProxy> GrProxyProvider::createMipMapProxyFromBitmap(const SkBitmap& bitmap,
-                                                                   SkColorSpace* dstColorSpace) {
-    SkDestinationSurfaceColorMode mipColorMode = dstColorSpace
-        ? SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware
-        : SkDestinationSurfaceColorMode::kLegacy;
-
-    if (!SkImageInfoIsValid(bitmap.info(), mipColorMode)) {
+sk_sp<GrTextureProxy> GrProxyProvider::createMipMapProxyFromBitmap(const SkBitmap& bitmap) {
+    if (!SkImageInfoIsValid(bitmap.info())) {
         return nullptr;
     }
 
@@ -300,7 +294,7 @@
     }
 
     ATRACE_ANDROID_FRAMEWORK("Upload MipMap Texture [%ux%u]", pixmap.width(), pixmap.height());
-    sk_sp<SkMipMap> mipmaps(SkMipMap::Build(pixmap, mipColorMode, nullptr));
+    sk_sp<SkMipMap> mipmaps(SkMipMap::Build(pixmap, nullptr));
     if (!mipmaps) {
         return nullptr;
     }
@@ -320,7 +314,7 @@
         return nullptr;
     }
 
-    GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(pixmap.info(), *this->caps());
+    GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(pixmap.info());
 
     if (0 == mipmaps->countLevels()) {
         return this->createTextureProxy(baseLevel, kNone_GrSurfaceFlags, 1, SkBudgeted::kYes,
@@ -328,7 +322,7 @@
     }
 
     sk_sp<GrTextureProxy> proxy = this->createLazyProxy(
-            [desc, baseLevel, mipmaps, mipColorMode](GrResourceProvider* resourceProvider) {
+            [desc, baseLevel, mipmaps](GrResourceProvider* resourceProvider) {
                 if (!resourceProvider) {
                     return sk_sp<GrTexture>();
                 }
@@ -353,7 +347,7 @@
                 }
 
                 return resourceProvider->createTexture(desc, SkBudgeted::kYes, texels.get(),
-                                                       mipLevelCount, mipColorMode);
+                                                       mipLevelCount);
             },
             desc, kTopLeft_GrSurfaceOrigin, GrMipMapped::kYes, SkBackingFit::kExact,
             SkBudgeted::kYes);
diff --git a/src/gpu/GrProxyProvider.h b/src/gpu/GrProxyProvider.h
index 76f0ae9..c466c98 100644
--- a/src/gpu/GrProxyProvider.h
+++ b/src/gpu/GrProxyProvider.h
@@ -100,8 +100,7 @@
     /*
      * Creates a new mipmapped texture proxy for the bitmap with mip levels generated by the cpu.
      */
-    sk_sp<GrTextureProxy> createMipMapProxyFromBitmap(const SkBitmap& bitmap,
-                                                      SkColorSpace* dstColorSpace);
+    sk_sp<GrTextureProxy> createMipMapProxyFromBitmap(const SkBitmap& bitmap);
 
     /*
      * Create a GrSurfaceProxy without any data.
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 456d8e4..e5bda32 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -792,10 +792,9 @@
                           &clippedSrcRect)) {
         return;
     }
-    bool allowSRGB = SkToBool(this->colorSpaceInfo().colorSpace());
     this->addDrawOp(clip, GrTextureOp::Make(std::move(proxy), filter, color, clippedSrcRect,
                                             clippedDstRect, aaType, constraint, viewMatrix,
-                                            std::move(colorSpaceXform), allowSRGB));
+                                            std::move(colorSpaceXform)));
 }
 
 void GrRenderTargetContext::fillRectWithLocalMatrix(const GrClip& clip,
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 2145190..b09506e 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -62,8 +62,7 @@
 }
 
 sk_sp<GrTexture> GrResourceProvider::createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted,
-                                                   const GrMipLevel texels[], int mipLevelCount,
-                                                   SkDestinationSurfaceColorMode mipColorMode) {
+                                                   const GrMipLevel texels[], int mipLevelCount) {
     ASSERT_SINGLE_OWNER
 
     SkASSERT(mipLevelCount > 0);
@@ -77,12 +76,7 @@
         return nullptr;
     }
 
-    sk_sp<GrTexture> tex(fGpu->createTexture(desc, budgeted, texels, mipLevelCount));
-    if (tex) {
-        tex->texturePriv().setMipColorMode(mipColorMode);
-    }
-
-    return tex;
+    return fGpu->createTexture(desc, budgeted, texels, mipLevelCount);
 }
 
 sk_sp<GrTexture> GrResourceProvider::getExactScratch(const GrSurfaceDesc& desc,
diff --git a/src/gpu/GrResourceProvider.h b/src/gpu/GrResourceProvider.h
index a853f08..35c3682 100644
--- a/src/gpu/GrResourceProvider.h
+++ b/src/gpu/GrResourceProvider.h
@@ -68,7 +68,7 @@
     sk_sp<GrTexture> createTexture(const GrSurfaceDesc&, SkBudgeted, uint32_t flags = 0);
 
     sk_sp<GrTexture> createTexture(const GrSurfaceDesc&, SkBudgeted, const GrMipLevel texels[],
-                                   int mipLevelCount, SkDestinationSurfaceColorMode mipColorMode);
+                                   int mipLevelCount);
 
     // Create a potentially loose fit texture with the provided data
     sk_sp<GrTexture> createTexture(const GrSurfaceDesc&, SkBudgeted, SkBackingFit,
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index 4d44d1e..dd15b18 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -153,8 +153,7 @@
             texels[i].fRowBytes = 0;
         }
 
-        surface = resourceProvider->createTexture(desc, fBudgeted, texels.get(), mipCount,
-                                                  SkDestinationSurfaceColorMode::kLegacy);
+        surface = resourceProvider->createTexture(desc, fBudgeted, texels.get(), mipCount);
         if (surface) {
             SkASSERT(surface->asTexture());
             SkASSERT(GrMipMapped::kYes == surface->asTexture()->texturePriv().mipMapped());
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index dd06317..cd3e705 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -47,9 +47,7 @@
         : INHERITED(gpu, desc)
         , fSamplerType(samplerType)
         , fHighestFilterMode(highestFilterMode)
-        , fMipMapsStatus(mipMapsStatus)
-        // Mip color mode is explicitly set after creation via GrTexturePriv
-        , fMipColorMode(SkDestinationSurfaceColorMode::kLegacy) {
+        , fMipMapsStatus(mipMapsStatus) {
     if (GrMipMapsStatus::kNotAllocated == fMipMapsStatus) {
         fMaxMipMapLevel = 0;
     } else {
diff --git a/src/gpu/GrTexturePriv.h b/src/gpu/GrTexturePriv.h
index 80ac75f..4517e9e 100644
--- a/src/gpu/GrTexturePriv.h
+++ b/src/gpu/GrTexturePriv.h
@@ -53,11 +53,6 @@
     /** The filter used is clamped to this value in GrProcessor::TextureSampler. */
     GrSamplerState::Filter highestFilterMode() const { return fTexture->fHighestFilterMode; }
 
-    void setMipColorMode(SkDestinationSurfaceColorMode colorMode) const {
-        fTexture->fMipColorMode = colorMode;
-    }
-    SkDestinationSurfaceColorMode mipColorMode() const { return fTexture->fMipColorMode; }
-
     static void ComputeScratchKey(const GrSurfaceDesc&, GrScratchKey*);
     static void ComputeScratchKey(GrPixelConfig config, int width, int height,
                                   bool isRenderTarget, int sampleCnt,
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 883f326..06307a1 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -157,7 +157,7 @@
         return nullptr;
     }
 
-    GrPixelConfig config = SkImageInfo2GrPixelConfig(origInfo, *context->contextPriv().caps());
+    GrPixelConfig config = SkImageInfo2GrPixelConfig(origInfo);
     if (kUnknown_GrPixelConfig == config) {
         return nullptr;
     }
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 528d133..6767a1b 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -41,12 +41,12 @@
 #include "effects/GrPorterDuffXferProcessor.h"
 #include "effects/GrXfermodeFragmentProcessor.h"
 
-GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo& info, const GrCaps& caps) {
+GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo& info) {
     GrSurfaceDesc desc;
     desc.fFlags = kNone_GrSurfaceFlags;
     desc.fWidth = info.width();
     desc.fHeight = info.height();
-    desc.fConfig = SkImageInfo2GrPixelConfig(info, caps);
+    desc.fConfig = SkImageInfo2GrPixelConfig(info);
     desc.fSampleCnt = 1;
     return desc;
 }
@@ -66,17 +66,12 @@
 
 //////////////////////////////////////////////////////////////////////////////
 sk_sp<GrTextureProxy> GrUploadBitmapToTextureProxy(GrProxyProvider* proxyProvider,
-                                                   const SkBitmap& bitmap,
-                                                   SkColorSpace* dstColorSpace) {
+                                                   const SkBitmap& bitmap) {
     if (!bitmap.peekPixels(nullptr)) {
         return nullptr;
     }
 
-    SkDestinationSurfaceColorMode colorMode = dstColorSpace
-        ? SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware
-        : SkDestinationSurfaceColorMode::kLegacy;
-
-    if (!SkImageInfoIsValid(bitmap.info(), colorMode)) {
+    if (!SkImageInfoIsValid(bitmap.info())) {
         return nullptr;
     }
 
@@ -246,8 +241,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-GrPixelConfig SkImageInfo2GrPixelConfig(const SkColorType type, SkColorSpace* cs,
-                                        const GrCaps& caps) {
+GrPixelConfig SkColorType2GrPixelConfig(const SkColorType type) {
     switch (type) {
         case kUnknown_SkColorType:
             return kUnknown_GrPixelConfig;
@@ -258,15 +252,11 @@
         case kARGB_4444_SkColorType:
             return kRGBA_4444_GrPixelConfig;
         case kRGBA_8888_SkColorType:
-            return (caps.srgbSupport() && cs && cs->gammaCloseToSRGB())
-                   ? kSRGBA_8888_GrPixelConfig : kRGBA_8888_GrPixelConfig;
-        // TODO: We're checking for srgbSupport, but we can then end up picking sBGRA as our pixel
-        // config (which may not be supported). We need a better test here.
+            return kRGBA_8888_GrPixelConfig;
         case kRGB_888x_SkColorType:
             return kRGB_888_GrPixelConfig;
         case kBGRA_8888_SkColorType:
-            return (caps.srgbSupport() && cs && cs->gammaCloseToSRGB())
-                   ? kSBGRA_8888_GrPixelConfig : kBGRA_8888_GrPixelConfig;
+            return kBGRA_8888_GrPixelConfig;
         case kRGBA_1010102_SkColorType:
             return kRGBA_1010102_GrPixelConfig;
         case kRGB_101010x_SkColorType:
@@ -280,8 +270,8 @@
     return kUnknown_GrPixelConfig;
 }
 
-GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info, const GrCaps& caps) {
-    return SkImageInfo2GrPixelConfig(info.colorType(), info.colorSpace(), caps);
+GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info) {
+    return SkColorType2GrPixelConfig(info.colorType());
 }
 
 bool GrPixelConfigToColorType(GrPixelConfig config, SkColorType* ctOut) {
@@ -322,8 +312,6 @@
                                            std::unique_ptr<GrFragmentProcessor>* shaderProcessor,
                                            SkBlendMode* primColorMode,
                                            GrPaint* grPaint) {
-    grPaint->setAllowSRGBInputs(colorSpaceInfo.isGammaCorrect());
-
     // Convert SkPaint color to 4f format, including optional linearizing and gamut conversion.
     GrColor4f origColor = SkColorToUnpremulGrColor4f(skPaint.getColor(), colorSpaceInfo);
 
diff --git a/src/gpu/SkGr.h b/src/gpu/SkGr.h
index d8d227f..b766105 100644
--- a/src/gpu/SkGr.h
+++ b/src/gpu/SkGr.h
@@ -143,9 +143,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 // Misc Sk to Gr type conversions
 
-GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo&, const GrCaps&);
-GrPixelConfig SkImageInfo2GrPixelConfig(const SkColorType, SkColorSpace*, const GrCaps& caps);
-GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info, const GrCaps& caps);
+GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo&);
+GrPixelConfig SkColorType2GrPixelConfig(const SkColorType);
+GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info);
 
 bool GrPixelConfigToColorType(GrPixelConfig, SkColorType*);
 
@@ -206,8 +206,7 @@
  * The bitmap must have CPU-accessible pixels. Attempts to take advantage of faster paths for
  * yuv planes.
  */
-sk_sp<GrTextureProxy> GrUploadBitmapToTextureProxy(GrProxyProvider*, const SkBitmap&,
-                                                   SkColorSpace* dstColorSpace);
+sk_sp<GrTextureProxy> GrUploadBitmapToTextureProxy(GrProxyProvider*, const SkBitmap&);
 
 /**
  * Creates a new texture with mipmap levels and copies the baseProxy into the base layer.
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 4660cda..e20d013 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -52,7 +52,6 @@
     fRGBAToBGRAReadbackConversionsAreSlow = false;
     fUseBufferDataNullHint = SkToBool(GR_GL_USE_BUFFER_DATA_NULL_HINT);
     fDoManualMipmapping = false;
-    fSRGBDecodeDisableAffectsMipmaps = false;
     fClearToBoundaryValuesIsBroken = false;
     fClearTextureSupport = false;
     fDrawArraysBaseVertexIsBroken = false;
@@ -588,11 +587,6 @@
     // Safely moving textures between contexts requires fences.
     fCrossContextTextureSupport = fFenceSyncSupport;
 
-    fSRGBDecodeDisableSupport = ctxInfo.hasExtension("GL_EXT_texture_sRGB_decode");
-
-    fSRGBDecodeDisableAffectsMipmaps = fSRGBDecodeDisableSupport &&
-        kChromium_GrGLDriver != ctxInfo.driver();
-
     if (kGL_GrGLStandard == standard) {
         if (version >= GR_GL_VER(4, 1)) {
             fProgramBinarySupport = true;
@@ -1529,8 +1523,7 @@
     }
     fConfigTable[kBGRA_8888_GrPixelConfig].fSwizzle = GrSwizzle::RGBA();
 
-    // We only enable srgb support if both textures and FBOs support srgb,
-    // *and* we can disable sRGB decode-on-read, to support "legacy" mode.
+    // We only enable srgb support if both textures and FBOs support srgb.
     if (kGL_GrGLStandard == standard) {
         if (ctxInfo.version() >= GR_GL_VER(3,0)) {
             fSRGBSupport = true;
@@ -1555,11 +1548,6 @@
         fSRGBWriteControl = !disableSRGBWriteControlForAdreno4xx &&
             ctxInfo.hasExtension("GL_EXT_sRGB_write_control");
     }
-    if (contextOptions.fRequireDecodeDisableForSRGB && !fSRGBDecodeDisableSupport) {
-        // To support "legacy" L32 mode, we require the ability to turn off sRGB decode. Clients
-        // can opt-out of that requirement, if they intend to always do linear blending.
-        fSRGBSupport = false;
-    }
 
     // This is very conservative, if we're on a platform where N32 is BGRA, and using ES, disable
     // all sRGB support. Too much code relies on creating surfaces with N32 + sRGB colorspace,
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 76eec3a..e258eaa 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -343,8 +343,6 @@
 
     bool doManualMipmapping() const { return fDoManualMipmapping; }
 
-    bool srgbDecodeDisableAffectsMipmaps() const { return fSRGBDecodeDisableAffectsMipmaps; }
-
     void onDumpJSON(SkJSONWriter*) const override;
 
     bool rgba8888PixelsOpsAreSlow() const { return fRGBA8888PixelsOpsAreSlow; }
@@ -517,7 +515,6 @@
 
     // Driver workarounds
     bool fDoManualMipmapping : 1;
-    bool fSRGBDecodeDisableAffectsMipmaps : 1;
     bool fClearToBoundaryValuesIsBroken : 1;
     bool fDrawArraysBaseVertexIsBroken : 1;
     bool fUseDrawToClearColor : 1;
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 5bfe2e5..3c4b1e8 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -3004,8 +3004,8 @@
     return 0;
 }
 
-void GrGLGpu::bindTexture(int unitIdx, const GrSamplerState& samplerState, bool allowSRGBInputs,
-                          GrGLTexture* texture, GrSurfaceOrigin textureOrigin) {
+void GrGLGpu::bindTexture(int unitIdx, const GrSamplerState& samplerState, GrGLTexture* texture,
+                          GrSurfaceOrigin textureOrigin) {
     SkASSERT(texture);
 
 #ifdef SK_DEBUG
@@ -3050,24 +3050,10 @@
     newTexParams.fMinFilter = filter_to_gl_min_filter(filterMode);
     newTexParams.fMagFilter = filter_to_gl_mag_filter(filterMode);
 
-    if (this->glCaps().srgbDecodeDisableSupport() && GrPixelConfigIsSRGB(texture->config())) {
-        newTexParams.fSRGBDecode = allowSRGBInputs ? GR_GL_DECODE_EXT : GR_GL_SKIP_DECODE_EXT;
-        if (setAll || newTexParams.fSRGBDecode != oldTexParams.fSRGBDecode) {
-            this->setTextureUnit(unitIdx);
-            GL_CALL(TexParameteri(target, GR_GL_TEXTURE_SRGB_DECODE_EXT, newTexParams.fSRGBDecode));
-        }
-    }
-
 #ifdef SK_DEBUG
-    // We were supposed to ensure MipMaps were up-to-date and built correctly before getting here.
+    // We were supposed to ensure MipMaps were up-to-date before getting here.
     if (GrSamplerState::Filter::kMipMap == filterMode) {
         SkASSERT(!texture->texturePriv().mipMapsAreDirty());
-        if (GrPixelConfigIsSRGB(texture->config())) {
-            SkDestinationSurfaceColorMode colorMode = allowSRGBInputs
-                ? SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware
-                : SkDestinationSurfaceColorMode::kLegacy;
-            SkASSERT(texture->texturePriv().mipColorMode() == colorMode);
-        }
     }
 #endif
 
@@ -3159,8 +3145,8 @@
     }
 }
 
-void GrGLGpu::generateMipmaps(const GrSamplerState& params, bool allowSRGBInputs,
-                              GrGLTexture* texture, GrSurfaceOrigin textureOrigin) {
+void GrGLGpu::generateMipmaps(const GrSamplerState& params, GrGLTexture* texture,
+                              GrSurfaceOrigin textureOrigin) {
     SkASSERT(texture);
 
     // First, figure out if we need mips for this texture at all:
@@ -3176,17 +3162,6 @@
         return;
     }
 
-    // If this is an sRGB texture and the mips were previously built the "other" way
-    // (gamma-correct vs. not), then we need to rebuild them. We don't need to check for
-    // srgbSupport - we'll *never* get an sRGB pixel config if we don't support it.
-    SkDestinationSurfaceColorMode colorMode = allowSRGBInputs
-        ? SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware
-        : SkDestinationSurfaceColorMode::kLegacy;
-    if (GrPixelConfigIsSRGB(texture->config()) &&
-        colorMode != texture->texturePriv().mipColorMode()) {
-        texture->texturePriv().markMipMapsDirty();
-    }
-
     // If the mips aren't dirty, we're done:
     if (!texture->texturePriv().mipMapsAreDirty()) {
         return;
@@ -3203,30 +3178,14 @@
     this->setScratchTextureUnit();
     GL_CALL(BindTexture(target, texture->textureID()));
 
-    // Configure sRGB decode, if necessary. This state is the only thing needed for the driver
-    // call (glGenerateMipmap) to work correctly. Our manual method dirties other state, too.
-    if (this->glCaps().srgbDecodeDisableSupport() && GrPixelConfigIsSRGB(texture->config())) {
-        GrGLenum srgbDecode = allowSRGBInputs ? GR_GL_DECODE_EXT : GR_GL_SKIP_DECODE_EXT;
-        // Command buffer's sRGB decode extension doesn't influence mipmap generation correctly.
-        // If we set this to skip_decode, it appears to suppress sRGB -> Linear for each downsample,
-        // but not the Linear -> sRGB when writing the next level. The result is that mip-chains
-        // get progressively brighter as you go down. Forcing this to 'decode' gives predictable
-        // (and only slightly incorrect) results. See crbug.com/655247 (~comment 28)
-        if (!this->glCaps().srgbDecodeDisableAffectsMipmaps()) {
-            srgbDecode = GR_GL_DECODE_EXT;
-        }
-        GL_CALL(TexParameteri(target, GR_GL_TEXTURE_SRGB_DECODE_EXT, srgbDecode));
-    }
-
     // Either do manual mipmap generation or (if that fails), just rely on the driver:
-    if (!this->generateMipmap(texture, textureOrigin, allowSRGBInputs)) {
+    if (!this->generateMipmap(texture, textureOrigin)) {
         GL_CALL(GenerateMipmap(target));
     }
 
     texture->texturePriv().markMipMapsClean();
     texture->texturePriv().setMaxMipMapLevel(SkMipMap::ComputeLevelCount(
         texture->width(), texture->height()));
-    texture->texturePriv().setMipColorMode(colorMode);
 
     // We have potentially set lots of state on the texture. Easiest to dirty it all:
     texture->textureParamsModified();
@@ -3993,7 +3952,7 @@
     int w = srcRect.width();
     int h = srcRect.height();
 
-    this->bindTexture(0, GrSamplerState::ClampNearest(), true, srcTex, srcOrigin);
+    this->bindTexture(0, GrSamplerState::ClampNearest(), srcTex, srcOrigin);
 
     GrGLIRect dstVP;
     this->bindSurfaceFBOForPixelOps(dst, GR_GL_FRAMEBUFFER, &dstVP, kDst_TempFBOTarget);
@@ -4153,8 +4112,7 @@
 // Manual implementation of mipmap generation, to work around driver bugs w/sRGB.
 // Uses draw calls to do a series of downsample operations to successive mips.
 // If this returns false, then the calling code falls back to using glGenerateMipmap.
-bool GrGLGpu::generateMipmap(GrGLTexture* texture, GrSurfaceOrigin textureOrigin,
-                             bool gammaCorrect) {
+bool GrGLGpu::generateMipmap(GrGLTexture* texture, GrSurfaceOrigin textureOrigin) {
     // Our iterative downsample requires the ability to limit which level we're sampling:
     if (!this->glCaps().doManualMipmapping()) {
         return false;
@@ -4170,17 +4128,6 @@
         return false;
     }
 
-    // If we're mipping an sRGB texture, we need to ensure FB sRGB is correct:
-    if (GrPixelConfigIsSRGB(texture->config())) {
-        // If we have write-control, just set the state that we want:
-        if (this->glCaps().srgbWriteControl()) {
-            this->flushFramebufferSRGB(gammaCorrect);
-        } else if (!gammaCorrect) {
-            // If we don't have write-control we can't do non-gamma-correct mipmapping:
-            return false;
-        }
-    }
-
     int width = texture->width();
     int height = texture->height();
     int levelCount = SkMipMap::ComputeLevelCount(width, height) + 1;
@@ -4217,7 +4164,7 @@
     // Bind the texture, to get things configured for filtering.
     // We'll be changing our base level further below:
     this->setTextureUnit(0);
-    this->bindTexture(0, GrSamplerState::ClampBilerp(), gammaCorrect, texture, textureOrigin);
+    this->bindTexture(0, GrSamplerState::ClampBilerp(), texture, textureOrigin);
 
     // Vertex data:
     if (!fMipmapProgramArrayBuffer) {
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index b63a907..8bb45c2 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -54,12 +54,12 @@
     }
 
     // Used by GrGLProgram to configure OpenGL state.
-    void bindTexture(int unitIdx, const GrSamplerState& samplerState, bool allowSRGBInputs,
-                     GrGLTexture* texture, GrSurfaceOrigin textureOrigin);
+    void bindTexture(int unitIdx, const GrSamplerState& samplerState, GrGLTexture* texture,
+                     GrSurfaceOrigin textureOrigin);
 
     void bindTexelBuffer(int unitIdx, GrPixelConfig, GrGLBuffer*);
 
-    void generateMipmaps(const GrSamplerState& params, bool allowSRGBInputs, GrGLTexture* texture,
+    void generateMipmaps(const GrSamplerState& params, GrGLTexture* texture,
                          GrSurfaceOrigin textureOrigin);
 
     // These functions should be used to bind GL objects. They track the GL state and skip redundant
@@ -289,7 +289,7 @@
     bool copySurfaceAsBlitFramebuffer(GrSurface* dst, GrSurfaceOrigin dstOrigin,
                                       GrSurface* src, GrSurfaceOrigin srcOrigin,
                                       const SkIRect& srcRect, const SkIPoint& dstPoint);
-    bool generateMipmap(GrGLTexture* texture, GrSurfaceOrigin textureOrigin, bool gammaCorrect);
+    bool generateMipmap(GrGLTexture* texture, GrSurfaceOrigin textureOrigin);
     void clearStencilClipAsDraw(const GrFixedClip&, bool insideStencilMask,
                                 GrRenderTarget*, GrSurfaceOrigin);
 
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 7257638..95b1f0c 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -80,8 +80,7 @@
     int nextTexelBufferIdx = fNumTextureSamplers;
     fGeometryProcessor->setData(fProgramDataManager, primProc,
                                 GrFragmentProcessor::CoordTransformIter(pipeline));
-    this->bindTextures(primProc, pipeline.getAllowSRGBInputs(), &nextTexSamplerIdx,
-                       &nextTexelBufferIdx);
+    this->bindTextures(primProc, &nextTexSamplerIdx, &nextTexelBufferIdx);
 
     this->setFragmentData(primProc, pipeline, &nextTexSamplerIdx, &nextTexelBufferIdx);
 
@@ -91,7 +90,7 @@
 
     fXferProcessor->setData(fProgramDataManager, xp, dstTexture, offset);
     if (dstTexture) {
-        fGpu->bindTexture(nextTexSamplerIdx++, GrSamplerState::ClampNearest(), true,
+        fGpu->bindTexture(nextTexSamplerIdx++, GrSamplerState::ClampNearest(),
                           static_cast<GrGLTexture*>(dstTexture),
                           pipeline.dstTextureProxy()->origin());
     }
@@ -101,11 +100,11 @@
 
 void GrGLProgram::generateMipmaps(const GrPrimitiveProcessor& primProc,
                                   const GrPipeline& pipeline) {
-    this->generateMipmaps(primProc, pipeline.getAllowSRGBInputs());
+    this->generateMipmaps(primProc);
 
     GrFragmentProcessor::Iter iter(pipeline);
     while (const GrFragmentProcessor* fp  = iter.next()) {
-        this->generateMipmaps(*fp, pipeline.getAllowSRGBInputs());
+        this->generateMipmaps(*fp);
     }
 }
 
@@ -120,8 +119,7 @@
     GrGLSLFragmentProcessor* glslFP = glslIter.next();
     while (fp && glslFP) {
         glslFP->setData(fProgramDataManager, *fp);
-        this->bindTextures(*fp, pipeline.getAllowSRGBInputs(), nextTexSamplerIdx,
-                           nextTexelBufferIdx);
+        this->bindTextures(*fp, nextTexSamplerIdx, nextTexelBufferIdx);
         fp = iter.next();
         glslFP = glslIter.next();
     }
@@ -160,12 +158,11 @@
 }
 
 void GrGLProgram::bindTextures(const GrResourceIOProcessor& processor,
-                               bool allowSRGBInputs,
                                int* nextTexSamplerIdx,
                                int* nextTexelBufferIdx) {
     for (int i = 0; i < processor.numTextureSamplers(); ++i) {
         const GrResourceIOProcessor::TextureSampler& sampler = processor.textureSampler(i);
-        fGpu->bindTexture((*nextTexSamplerIdx)++, sampler.samplerState(), allowSRGBInputs,
+        fGpu->bindTexture((*nextTexSamplerIdx)++, sampler.samplerState(),
                           static_cast<GrGLTexture*>(sampler.peekTexture()),
                           sampler.proxy()->origin());
     }
@@ -176,10 +173,10 @@
     }
 }
 
-void GrGLProgram::generateMipmaps(const GrResourceIOProcessor& processor, bool allowSRGBInputs) {
+void GrGLProgram::generateMipmaps(const GrResourceIOProcessor& processor) {
     for (int i = 0; i < processor.numTextureSamplers(); ++i) {
         const GrResourceIOProcessor::TextureSampler& sampler = processor.textureSampler(i);
-        fGpu->generateMipmaps(sampler.samplerState(), allowSRGBInputs,
+        fGpu->generateMipmaps(sampler.samplerState(),
                               static_cast<GrGLTexture*>(sampler.peekTexture()),
                               sampler.proxy()->origin());
     }
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index 781baa4..b49b410 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -126,11 +126,10 @@
     void setRenderTargetState(const GrPrimitiveProcessor&, const GrRenderTargetProxy*);
 
     // Helper for setData() that binds textures and texel buffers to the appropriate texture units
-    void bindTextures(const GrResourceIOProcessor&, bool allowSRGBInputs, int* nextSamplerIdx,
-                      int* nextTexelBufferIdx);
+    void bindTextures(const GrResourceIOProcessor&, int* nextSamplerIdx, int* nextTexelBufferIdx);
 
     // Helper for generateMipmaps() that ensures mipmaps are up to date
-    void generateMipmaps(const GrResourceIOProcessor&, bool allowSRGBInputs);
+    void generateMipmaps(const GrResourceIOProcessor&);
 
     // these reflect the current values of uniforms (GL uniform values travel with program)
     RenderTargetState fRenderTargetState;
diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h
index 67eab43..10b8e26 100644
--- a/src/gpu/gl/GrGLTexture.h
+++ b/src/gpu/gl/GrGLTexture.h
@@ -24,7 +24,6 @@
         GrGLenum fWrapT;
         GrGLenum fMaxMipMapLevel;
         GrGLenum fSwizzleRGBA[4];
-        GrGLenum fSRGBDecode;
         void invalidate() { memset(this, 0xff, sizeof(TexParams)); }
     };
 
diff --git a/src/gpu/ops/GrDashOp.cpp b/src/gpu/ops/GrDashOp.cpp
index ed2a847..1a8bfba 100644
--- a/src/gpu/ops/GrDashOp.cpp
+++ b/src/gpu/ops/GrDashOp.cpp
@@ -326,7 +326,6 @@
            bool fullDash, const GrUserStencilSettings* stencilSettings)
             : INHERITED(ClassID())
             , fColor(paint.getColor())
-            , fAllowsSRGBInputs(paint.getAllowSRGBInputs())
             , fDisableSRGBOutputConversion(paint.getDisableOutputConversionToSRGB())
             , fFullDash(fullDash)
             , fCap(cap)
@@ -687,9 +686,6 @@
         if (fDisableSRGBOutputConversion) {
             pipelineFlags |= GrPipeline::kDisableOutputConversionToSRGB_Flag;
         }
-        if (fAllowsSRGBInputs) {
-            pipelineFlags |= GrPipeline::kAllowSRGBInputs_Flag;
-        }
         const GrPipeline* pipeline = target->makePipeline(pipelineFlags, std::move(fProcessorSet),
                                                           target->detachAppliedClip());
         helper.recordDraw(target, gp.get(), pipeline);
@@ -742,7 +738,6 @@
 
     SkSTArray<1, LineData, true> fLines;
     GrColor fColor;
-    bool fAllowsSRGBInputs : 1;
     bool fDisableSRGBOutputConversion : 1;
     bool fDisallowCombineOnTouchOrOverlap : 1;
     bool fUsesLocalCoords : 1;
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index 1bb4782..950fe6e 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -611,11 +611,11 @@
                                           GrSamplerState::Filter filter, GrColor color,
                                           const SkRect& srcRect, const SkRect& dstRect,
                                           GrAAType aaType, SkCanvas::SrcRectConstraint constraint,
-                                          const SkMatrix& viewMatrix, sk_sp<GrColorSpaceXform> csxf,
-                                          bool allowSRBInputs) {
+                                          const SkMatrix& viewMatrix,
+                                          sk_sp<GrColorSpaceXform> csxf) {
         return std::unique_ptr<GrDrawOp>(new TextureOp(std::move(proxy), filter, color, srcRect,
                                                        dstRect, aaType, constraint, viewMatrix,
-                                                       std::move(csxf), allowSRBInputs));
+                                                       std::move(csxf)));
     }
 
     ~TextureOp() override {
@@ -644,7 +644,6 @@
 
     SkString dumpInfo() const override {
         SkString str;
-        str.appendf("AllowSRGBInputs: %d\n", fAllowSRGBInputs);
         str.appendf("# draws: %d\n", fDraws.count());
         auto proxies = this->proxies();
         for (int i = 0; i < fProxyCnt; ++i) {
@@ -699,15 +698,14 @@
     TextureOp(sk_sp<GrTextureProxy> proxy, GrSamplerState::Filter filter, GrColor color,
               const SkRect& srcRect, const SkRect& dstRect, GrAAType aaType,
               SkCanvas::SrcRectConstraint constraint, const SkMatrix& viewMatrix,
-              sk_sp<GrColorSpaceXform> csxf, bool allowSRGBInputs)
+              sk_sp<GrColorSpaceXform> csxf)
             : INHERITED(ClassID())
             , fColorSpaceXform(std::move(csxf))
             , fProxy0(proxy.release())
             , fFilter0(filter)
             , fProxyCnt(1)
             , fAAType(static_cast<unsigned>(aaType))
-            , fFinalized(0)
-            , fAllowSRGBInputs(allowSRGBInputs ? 1 : 0) {
+            , fFinalized(0) {
         SkASSERT(aaType != GrAAType::kMixedSamples);
         fPerspective = viewMatrix.hasPerspective();
         auto quad = GrPerspQuad(dstRect, viewMatrix);
@@ -772,9 +770,6 @@
         args.fCaps = &target->caps();
         args.fResourceProvider = target->resourceProvider();
         args.fFlags = 0;
-        if (fAllowSRGBInputs) {
-            args.fFlags |= GrPipeline::kAllowSRGBInputs_Flag;
-        }
         if (GrAAType::kMSAA == this->aaType()) {
             args.fFlags |= GrPipeline::kHWAntialias_Flag;
         }
@@ -1025,7 +1020,6 @@
     unsigned fDomain : 1;
     // Used to track whether fProxy is ref'ed or has a pending IO after finalize() is called.
     unsigned fFinalized : 1;
-    unsigned fAllowSRGBInputs : 1;
 
     typedef GrMeshDrawOp INHERITED;
 };
@@ -1040,10 +1034,9 @@
 std::unique_ptr<GrDrawOp> Make(sk_sp<GrTextureProxy> proxy, GrSamplerState::Filter filter,
                                GrColor color, const SkRect& srcRect, const SkRect& dstRect,
                                GrAAType aaType, SkCanvas::SrcRectConstraint constraint,
-                               const SkMatrix& viewMatrix, sk_sp<GrColorSpaceXform> csxf,
-                               bool allowSRGBInputs) {
+                               const SkMatrix& viewMatrix, sk_sp<GrColorSpaceXform> csxf) {
     return TextureOp::Make(std::move(proxy), filter, color, srcRect, dstRect, aaType, constraint,
-                           viewMatrix, std::move(csxf), allowSRGBInputs);
+                           viewMatrix, std::move(csxf));
 }
 
 }  // namespace GrTextureOp
@@ -1075,7 +1068,6 @@
     GrSamplerState::Filter filter = (GrSamplerState::Filter)random->nextULessThan(
             static_cast<uint32_t>(GrSamplerState::Filter::kMipMap) + 1);
     auto csxf = GrTest::TestColorXform(random);
-    bool allowSRGBInputs = random->nextBool();
     GrAAType aaType = GrAAType::kNone;
     if (random->nextBool()) {
         aaType = (fsaaType == GrFSAAType::kUnifiedMSAA) ? GrAAType::kMSAA : GrAAType::kCoverage;
@@ -1083,7 +1075,7 @@
     auto constraint = random->nextBool() ? SkCanvas::kStrict_SrcRectConstraint
                                          : SkCanvas::kFast_SrcRectConstraint;
     return GrTextureOp::Make(std::move(proxy), filter, color, srcRect, rect, aaType, constraint,
-                             viewMatrix, std::move(csxf), allowSRGBInputs);
+                             viewMatrix, std::move(csxf));
 }
 
 #endif
diff --git a/src/gpu/ops/GrTextureOp.h b/src/gpu/ops/GrTextureOp.h
index d61b36e..e99bd0a 100644
--- a/src/gpu/ops/GrTextureOp.h
+++ b/src/gpu/ops/GrTextureOp.h
@@ -28,5 +28,5 @@
 std::unique_ptr<GrDrawOp> Make(sk_sp<GrTextureProxy>, GrSamplerState::Filter, GrColor,
                                const SkRect& srcRect, const SkRect& dstRect, GrAAType,
                                SkCanvas::SrcRectConstraint, const SkMatrix& viewMatrix,
-                               sk_sp<GrColorSpaceXform>, bool allowSRGBInputs);
+                               sk_sp<GrColorSpaceXform>);
 }
diff --git a/src/gpu/text/GrAtlasManager.cpp b/src/gpu/text/GrAtlasManager.cpp
index e9737cc..f75224d 100644
--- a/src/gpu/text/GrAtlasManager.cpp
+++ b/src/gpu/text/GrAtlasManager.cpp
@@ -71,14 +71,14 @@
 GrAtlasManager::~GrAtlasManager() {
 }
 
-static GrPixelConfig mask_format_to_pixel_config(GrMaskFormat format, const GrCaps& caps) {
+static GrPixelConfig mask_format_to_pixel_config(GrMaskFormat format) {
     switch (format) {
         case kA8_GrMaskFormat:
             return kAlpha_8_GrPixelConfig;
         case kA565_GrMaskFormat:
             return kRGB_565_GrPixelConfig;
         case kARGB_GrMaskFormat:
-            return caps.srgbSupport() ? kSRGBA_8888_GrPixelConfig : kRGBA_8888_GrPixelConfig;
+            return kRGBA_8888_GrPixelConfig;
         default:
             SkDEBUGFAIL("unsupported GrMaskFormat");
             return kAlpha_8_GrPixelConfig;
@@ -208,7 +208,7 @@
 bool GrAtlasManager::initAtlas(GrMaskFormat format) {
     int index = MaskFormatToAtlasIndex(format);
     if (!fAtlases[index]) {
-        GrPixelConfig config = mask_format_to_pixel_config(format, *fCaps);
+        GrPixelConfig config = mask_format_to_pixel_config(format);
         int width = fAtlasConfigs[index].fWidth;
         int height = fAtlasConfigs[index].fHeight;
         int numPlotsX = fAtlasConfigs[index].numPlotsX();
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 76a1417..602e9e1 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -29,7 +29,6 @@
     **************************************************************************/
     fMipMapSupport = true;   // always available in Vulkan
     fSRGBSupport = true;   // always available in Vulkan
-    fSRGBDecodeDisableSupport = true;  // always available in Vulkan
     fNPOTTextureTileSupport = true;  // always available in Vulkan
     fDiscardRenderTargetSupport = true;
     fReuseScratchTextures = true; //TODO: figure this out
@@ -477,15 +476,13 @@
                               VK_IMAGE_USAGE_TRANSFER_DST_BIT |
                               VK_IMAGE_USAGE_SAMPLED_BIT |
                               VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
-    VkImageCreateFlags createFlags = GrVkFormatIsSRGB(format, nullptr)
-        ? VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT : 0;
     VkImageFormatProperties properties;
     GR_VK_CALL(interface, GetPhysicalDeviceImageFormatProperties(physDev,
                                                                  format,
                                                                  VK_IMAGE_TYPE_2D,
                                                                  VK_IMAGE_TILING_OPTIMAL,
                                                                  usage,
-                                                                 createFlags,
+                                                                 0,  // createFlags
                                                                  &properties));
     VkSampleCountFlags flags = properties.sampleCounts;
     if (flags & VK_SAMPLE_COUNT_1_BIT) {
diff --git a/src/gpu/vk/GrVkCopyManager.cpp b/src/gpu/vk/GrVkCopyManager.cpp
index c105922..28ca8b4 100644
--- a/src/gpu/vk/GrVkCopyManager.cpp
+++ b/src/gpu/vk/GrVkCopyManager.cpp
@@ -262,7 +262,7 @@
     VkDescriptorImageInfo imageInfo;
     memset(&imageInfo, 0, sizeof(VkDescriptorImageInfo));
     imageInfo.sampler = sampler->sampler();
-    imageInfo.imageView = srcTex->textureView(true)->imageView();
+    imageInfo.imageView = srcTex->textureView()->imageView();
     imageInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
 
     VkWriteDescriptorSet writeInfo;
@@ -353,7 +353,7 @@
     // One sampler, texture view, and texture
     SkSTArray<3, const GrVkResource*> descriptorResources;
     descriptorResources.push_back(sampler);
-    descriptorResources.push_back(srcTex->textureView(true));
+    descriptorResources.push_back(srcTex->textureView());
     descriptorResources.push_back(srcTex->resource());
 
     cmdBuffer->bindDescriptorSets(gpu,
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 2525c5c..772a92f 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -1213,14 +1213,10 @@
         mipLevels = SkMipMap::ComputeLevelCount(w, h) + 1;
     }
 
-    // sRGB format images may need to be aliased to linear for various reasons (legacy mode):
-    VkImageCreateFlags createFlags = GrVkFormatIsSRGB(pixelFormat, nullptr)
-        ? VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT : 0;
-
     const VkImageCreateInfo imageCreateInfo = {
             VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,  // sType
             nullptr,                              // pNext
-            createFlags,                          // VkImageCreateFlags
+            0,                                    // VkImageCreateFlags
             VK_IMAGE_TYPE_2D,                     // VkImageType
             pixelFormat,                          // VkFormat
             {(uint32_t)w, (uint32_t)h, 1},        // VkExtent3D
diff --git a/src/gpu/vk/GrVkImage.cpp b/src/gpu/vk/GrVkImage.cpp
index 9480a7b..a99134b 100644
--- a/src/gpu/vk/GrVkImage.cpp
+++ b/src/gpu/vk/GrVkImage.cpp
@@ -136,14 +136,10 @@
     SkASSERT(VK_IMAGE_TILING_OPTIMAL == imageDesc.fImageTiling ||
              VK_SAMPLE_COUNT_1_BIT == vkSamples);
 
-    // sRGB format images may need to be aliased to linear for various reasons (legacy mode):
-    VkImageCreateFlags createFlags = GrVkFormatIsSRGB(imageDesc.fFormat, nullptr)
-        ? VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT : 0;
-
     const VkImageCreateInfo imageCreateInfo = {
         VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,         // sType
         nullptr,                                     // pNext
-        createFlags,                                 // VkImageCreateFlags
+        0,                                           // VkImageCreateFlags
         imageDesc.fImageType,                        // VkImageType
         imageDesc.fFormat,                           // VkFormat
         { imageDesc.fWidth, imageDesc.fHeight, 1 },  // VkExtent3D
diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp
index 10e757e..5d4189f 100644
--- a/src/gpu/vk/GrVkPipelineState.cpp
+++ b/src/gpu/vk/GrVkPipelineState.cpp
@@ -281,7 +281,7 @@
         fSamplerDescriptorSet = gpu->resourceProvider().getSamplerDescriptorSet(fSamplerDSHandle);
         int samplerDSIdx = GrVkUniformHandler::kSamplerDescSet;
         fDescriptorSets[samplerDSIdx] = fSamplerDescriptorSet->descriptorSet();
-        this->writeSamplers(gpu, textureBindings, pipeline.getAllowSRGBInputs());
+        this->writeSamplers(gpu, textureBindings);
     }
 
     if (fNumTexelBuffers) {
@@ -372,8 +372,7 @@
 
 void GrVkPipelineState::writeSamplers(
         GrVkGpu* gpu,
-        const SkTArray<const GrResourceIOProcessor::TextureSampler*>& textureBindings,
-        bool allowSRGBInputs) {
+        const SkTArray<const GrResourceIOProcessor::TextureSampler*>& textureBindings) {
     SkASSERT(fNumSamplers == textureBindings.count());
 
     for (int i = 0; i < textureBindings.count(); ++i) {
@@ -388,7 +387,7 @@
         textureResource->ref();
         fTextures.push(textureResource);
 
-        const GrVkImageView* textureView = texture->textureView(allowSRGBInputs);
+        const GrVkImageView* textureView = texture->textureView();
         textureView->ref();
         fTextureViews.push(textureView);
 
diff --git a/src/gpu/vk/GrVkPipelineState.h b/src/gpu/vk/GrVkPipelineState.h
index 2794b99..4ccd1d6 100644
--- a/src/gpu/vk/GrVkPipelineState.h
+++ b/src/gpu/vk/GrVkPipelineState.h
@@ -108,8 +108,7 @@
 
     void writeSamplers(
             GrVkGpu* gpu,
-            const SkTArray<const GrResourceIOProcessor::TextureSampler*>& textureBindings,
-            bool allowSRGBInputs);
+            const SkTArray<const GrResourceIOProcessor::TextureSampler*>& textureBindings);
 
     void writeTexelBuffers(
             GrVkGpu* gpu,
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp
index 116b37e..c4c7a8f 100644
--- a/src/gpu/vk/GrVkTexture.cpp
+++ b/src/gpu/vk/GrVkTexture.cpp
@@ -34,8 +34,7 @@
     , GrVkImage(info, std::move(layout), GrBackendObjectOwnership::kOwned)
     , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, highest_filter_mode(desc.fConfig),
                 mipMapsStatus)
-    , fTextureView(view)
-    , fLinearTextureView(nullptr) {
+    , fTextureView(view) {
     SkASSERT((GrMipMapsStatus::kNotAllocated == mipMapsStatus) == (1 == info.fLevelCount));
     this->registerWithCache(budgeted);
 }
@@ -52,8 +51,7 @@
     , GrVkImage(info, std::move(layout), ownership)
     , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, highest_filter_mode(desc.fConfig),
                 mipMapsStatus)
-    , fTextureView(view)
-    , fLinearTextureView(nullptr) {
+    , fTextureView(view) {
     SkASSERT((GrMipMapsStatus::kNotAllocated == mipMapsStatus) == (1 == info.fLevelCount));
     this->registerWithCacheWrapped();
 }
@@ -70,8 +68,7 @@
     , GrVkImage(info, layout, ownership)
     , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, highest_filter_mode(desc.fConfig),
                 mipMapsStatus)
-    , fTextureView(view)
-    , fLinearTextureView(nullptr) {
+    , fTextureView(view) {
     SkASSERT((GrMipMapsStatus::kNotAllocated == mipMapsStatus) == (1 == info.fLevelCount));
 }
 
@@ -126,7 +123,6 @@
 GrVkTexture::~GrVkTexture() {
     // either release or abandon should have been called by the owner of this object.
     SkASSERT(!fTextureView);
-    SkASSERT(!fLinearTextureView);
 }
 
 void GrVkTexture::onRelease() {
@@ -136,11 +132,6 @@
         fTextureView = nullptr;
     }
 
-    if (fLinearTextureView) {
-        fLinearTextureView->unref(this->getVkGpu());
-        fLinearTextureView = nullptr;
-    }
-
     this->releaseImage(this->getVkGpu());
 
     INHERITED::onRelease();
@@ -152,11 +143,6 @@
         fTextureView = nullptr;
     }
 
-    if (fLinearTextureView) {
-        fLinearTextureView->unrefAndAbandon();
-        fLinearTextureView = nullptr;
-    }
-
     this->abandonImage();
     INHERITED::onAbandon();
 }
@@ -170,20 +156,8 @@
     return static_cast<GrVkGpu*>(this->getGpu());
 }
 
-const GrVkImageView* GrVkTexture::textureView(bool allowSRGB) {
-    VkFormat linearFormat;
-    if (allowSRGB || !GrVkFormatIsSRGB(fInfo.fFormat, &linearFormat)) {
-        return fTextureView;
-    }
-
-    if (!fLinearTextureView) {
-        fLinearTextureView = GrVkImageView::Create(this->getVkGpu(), fInfo.fImage,
-                                                   linearFormat, GrVkImageView::kColor_Type,
-                                                   fInfo.fLevelCount);
-        SkASSERT(fLinearTextureView);
-    }
-
-    return fLinearTextureView;
+const GrVkImageView* GrVkTexture::textureView() {
+    return fTextureView;
 }
 
 bool GrVkTexture::reallocForMipmap(GrVkGpu* gpu, uint32_t mipLevels) {
@@ -243,10 +217,6 @@
 
     oldResource->unref(gpu);
     oldView->unref(gpu);
-    if (fLinearTextureView) {
-        fLinearTextureView->unref(gpu);
-        fLinearTextureView = nullptr;
-    }
 
     this->setNewResource(info.fImage, info.fAlloc, info.fImageTiling);
     fTextureView = textureView;
diff --git a/src/gpu/vk/GrVkTexture.h b/src/gpu/vk/GrVkTexture.h
index 55239e3..91ed671 100644
--- a/src/gpu/vk/GrVkTexture.h
+++ b/src/gpu/vk/GrVkTexture.h
@@ -33,7 +33,7 @@
 
     void textureParamsModified() override {}
 
-    const GrVkImageView* textureView(bool allowSRGB);
+    const GrVkImageView* textureView();
 
     bool reallocForMipmap(GrVkGpu* gpu, uint32_t mipLevels);
 
@@ -67,7 +67,6 @@
                 GrBackendObjectOwnership);
 
     const GrVkImageView*     fTextureView;
-    const GrVkImageView*     fLinearTextureView;
 
     typedef GrTexture INHERITED;
 };
diff --git a/src/gpu/vk/GrVkUtil.cpp b/src/gpu/vk/GrVkUtil.cpp
index e61d7bc..2b0bba7 100644
--- a/src/gpu/vk/GrVkUtil.cpp
+++ b/src/gpu/vk/GrVkUtil.cpp
@@ -167,105 +167,6 @@
     }
 }
 
-bool GrVkFormatIsSRGB(VkFormat format, VkFormat* linearFormat) {
-    VkFormat linearFmt = format;
-    switch (format) {
-        case VK_FORMAT_R8_SRGB:
-            linearFmt = VK_FORMAT_R8_UNORM;
-            break;
-        case VK_FORMAT_R8G8_SRGB:
-            linearFmt = VK_FORMAT_R8G8_UNORM;
-            break;
-        case VK_FORMAT_R8G8B8_SRGB:
-            linearFmt = VK_FORMAT_R8G8B8_UNORM;
-            break;
-        case VK_FORMAT_B8G8R8_SRGB:
-            linearFmt = VK_FORMAT_B8G8R8_UNORM;
-            break;
-        case VK_FORMAT_R8G8B8A8_SRGB:
-            linearFmt = VK_FORMAT_R8G8B8A8_UNORM;
-            break;
-        case VK_FORMAT_B8G8R8A8_SRGB:
-            linearFmt = VK_FORMAT_B8G8R8A8_UNORM;
-            break;
-        case VK_FORMAT_A8B8G8R8_SRGB_PACK32:
-            linearFmt = VK_FORMAT_A8B8G8R8_UNORM_PACK32;
-            break;
-        case VK_FORMAT_BC1_RGB_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_BC1_RGB_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_BC1_RGBA_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_BC1_RGBA_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_BC2_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_BC2_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_BC3_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_BC3_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_BC7_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_BC7_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_4x4_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_4x4_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_5x4_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_5x4_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_5x5_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_5x5_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_6x5_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_6x5_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_6x6_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_6x6_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_8x5_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_8x5_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_8x6_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_8x6_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_8x8_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_8x8_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_10x5_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_10x5_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_10x6_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_10x6_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_10x8_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_10x8_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_10x10_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_10x10_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_12x10_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_12x10_UNORM_BLOCK;
-            break;
-        case VK_FORMAT_ASTC_12x12_SRGB_BLOCK:
-            linearFmt = VK_FORMAT_ASTC_12x12_UNORM_BLOCK;
-            break;
-        default:
-            break;
-    }
-    if (linearFormat) {
-        *linearFormat = linearFmt;
-    }
-    return (linearFmt != format);
-}
-
 bool GrSampleCountToVkSampleCount(uint32_t samples, VkSampleCountFlagBits* vkSamples) {
     SkASSERT(samples >= 1);
     switch (samples) {
diff --git a/src/gpu/vk/GrVkUtil.h b/src/gpu/vk/GrVkUtil.h
index 01688c8..08eef1a 100644
--- a/src/gpu/vk/GrVkUtil.h
+++ b/src/gpu/vk/GrVkUtil.h
@@ -44,12 +44,6 @@
  */
 bool GrVkFormatPixelConfigPairIsValid(VkFormat, GrPixelConfig);
 
-/**
- * Returns true if the given vulkan texture format is sRGB encoded.
- * Also provides the non-sRGB version, if there is one.
- */
-bool GrVkFormatIsSRGB(VkFormat format, VkFormat* linearFormat);
-
 bool GrSampleCountToVkSampleCount(uint32_t samples, VkSampleCountFlagBits* vkSamples);
 
 bool GrCompileVkShaderModule(const GrVkGpu* gpu,