Reland "Reland "Pass in a SkColorType into SkImage_Gpu ctor.""

This reverts commit 9ed88b310117915f61df73720715fc60a711f1f0.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Reland "Pass in a SkColorType into SkImage_Gpu ctor.""
> 
> This reverts commit 938106dcccf4cd31020d767c95ee74d728e42370.
> 
> Reason for revert: Most likely cause of Chrome roll failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/2013502
> 
> Original change's description:
> > Reland "Pass in a SkColorType into SkImage_Gpu ctor."
> > 
> > This reverts commit 42032cb88fb70dcc3cda02451b712e747a9b6171.
> > 
> > Reason for revert: Relanding now that pre CLS that fix initial issue landed
> > 
> > Original change's description:
> > > Revert "Pass in a SkColorType into SkImage_Gpu ctor."
> > > 
> > > This reverts commit 1d17543133c023da03f1ef4ab0a125ca3782957c.
> > > 
> > > Reason for revert: android bots
> > > 
> > > Original change's description:
> > > > Pass in a SkColorType into SkImage_Gpu ctor.
> > > > 
> > > > This allows us to get rid of using the GrPixelConfig on proxy to create
> > > > the SkColorType
> > > > 
> > > > Bug: skia:6718
> > > > Change-Id: I1758b79152fa1e8a1796e55d19f5e8ca0b0e8b7b
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264396
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > > 
> > > TBR=egdaniel@google.com,robertphillips@google.com
> > > 
> > > Change-Id: I449e6b0750d611346791beb1dd1346106ad01741
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:6718
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264469
> > > Reviewed-by: Mike Klein <mtklein@google.com>
> > > Commit-Queue: Mike Klein <mtklein@google.com>
> > 
> > TBR=egdaniel@google.com,mtklein@google.com,robertphillips@google.com
> > 
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> > 
> > Bug: skia:6718
> > Change-Id: I8088b4e96d1f2c73be03d150fb8f8280a21db5de
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265496
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,robertphillips@google.com
> 
> Change-Id: Idded694199b5c090a727e9b84251ba4700716c1f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:6718
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265603
> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>

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

Bug: skia:6718
Change-Id: Iaed2c5de04bfedcc85f75fb581f1c1fd2775bcde
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265762
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/gm/flippity.cpp b/gm/flippity.cpp
index 41895ff..05bfa93 100644
--- a/gm/flippity.cpp
+++ b/gm/flippity.cpp
@@ -139,10 +139,10 @@
     }
 
     GrSwizzle swizzle = context->priv().caps()->getReadSwizzle(proxy->backendFormat(),
-                                                                  GrColorType::kRGBA_8888);
+                                                               GrColorType::kRGBA_8888);
     GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
-    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(context), kNeedNewImageUniqueID, kOpaque_SkAlphaType,
-                                   std::move(view), nullptr);
+    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(context), kNeedNewImageUniqueID, std::move(view),
+                                   ii.colorType(), kOpaque_SkAlphaType, nullptr);
 }
 
 // Here we're converting from a matrix that is intended for UVs to a matrix that is intended
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index 22beac5..da4a79b 100644
--- a/gm/image_pict.cpp
+++ b/gm/image_pict.cpp
@@ -289,8 +289,9 @@
 
         // No API to draw a GrTexture directly, so we cheat and create a private image subclass
         sk_sp<SkImage> texImage(new SkImage_Gpu(sk_ref_sp(canvas->getGrContext()),
-                                                image->uniqueID(), kPremul_SkAlphaType,
-                                                std::move(view), image->refColorSpace()));
+                                                image->uniqueID(), std::move(view),
+                                                image->colorType(), image->alphaType(),
+                                                image->refColorSpace()));
         canvas->drawImage(texImage.get(), x, y);
     }
 
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h
index 7bf07c6..b02da3b 100644
--- a/include/private/GrTypesPriv.h
+++ b/include/private/GrTypesPriv.h
@@ -1316,6 +1316,31 @@
     SkUNREACHABLE;
 }
 
+// In general we try to not mix CompressionType and ColorType, but currently SkImage still requires
+// an SkColorType even for CompressedTypes so we need some conversion.
+static constexpr SkColorType GrCompressionTypeToSkColorType(SkImage::CompressionType compression) {
+    switch (compression) {
+        case SkImage::CompressionType::kNone:            return kUnknown_SkColorType;
+        case SkImage::CompressionType::kETC2_RGB8_UNORM: return kRGB_888x_SkColorType;
+        case SkImage::CompressionType::kBC1_RGB8_UNORM:  return kRGB_888x_SkColorType;
+        case SkImage::CompressionType::kBC1_RGBA8_UNORM: return kRGBA_8888_SkColorType;
+    }
+
+    SkUNREACHABLE;
+}
+
+static constexpr GrColorType GrMaskFormatToColorType(GrMaskFormat format) {
+    switch (format) {
+        case kA8_GrMaskFormat:
+            return GrColorType::kAlpha_8;
+        case kA565_GrMaskFormat:
+            return GrColorType::kBGR_565;
+        case kARGB_GrMaskFormat:
+            return GrColorType::kRGBA_8888;
+    }
+    SkUNREACHABLE;
+}
+
 /**
  * Ref-counted object that calls a callback from its destructor.
  */
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index 9f9148f..46fa72d 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -368,7 +368,8 @@
 #if SK_SUPPORT_GPU
 ///////////////////////////////////////////////////////////////////////////////
 static sk_sp<SkImage> wrap_proxy_in_image(GrRecordingContext* context, sk_sp<GrTextureProxy> proxy,
-                                          SkAlphaType alphaType, sk_sp<SkColorSpace> colorSpace) {
+                                          SkColorType colorType, SkAlphaType alphaType,
+                                          sk_sp<SkColorSpace> colorSpace) {
     // CONTEXT TODO: remove this use of 'backdoor' to create an SkImage
     // TODO: Once SkSpecialImage stores a GrSurfaceProxyView instead of a proxy, use that to create
     // the view here.
@@ -376,8 +377,8 @@
     const GrSwizzle& swizzle = proxy->textureSwizzle();
     GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
     return sk_make_sp<SkImage_Gpu>(sk_ref_sp(context->priv().backdoor()),
-                                   kNeedNewImageUniqueID, alphaType,
-                                   std::move(view), std::move(colorSpace));
+                                   kNeedNewImageUniqueID, std::move(view), colorType, alphaType,
+                                   std::move(colorSpace));
 }
 
 class SkSpecialImage_Gpu : public SkSpecialImage_Base {
@@ -423,7 +424,8 @@
         // to be tightened (if it is deferred).
         sk_sp<SkImage> img =
                 sk_sp<SkImage>(new SkImage_Gpu(sk_ref_sp(canvas->getGrContext()), this->uniqueID(),
-                                               fAlphaType, std::move(view), fColorSpace));
+                                               std::move(view), this->colorType(), fAlphaType,
+                                               fColorSpace));
 
         canvas->drawImageRect(img, this->subset(),
                               dst, paint, SkCanvas::kStrict_SrcRectConstraint);
@@ -504,7 +506,8 @@
                 *subset == SkIRect::MakeSize(fTextureProxy->dimensions())) {
                 fTextureProxy->priv().exactify(false);
                 // The existing GrTexture is already tight so reuse it in the SkImage
-                return wrap_proxy_in_image(fContext, fTextureProxy, fAlphaType, fColorSpace);
+                return wrap_proxy_in_image(fContext, fTextureProxy, this->colorType(), fAlphaType,
+                                           fColorSpace);
             }
 
             sk_sp<GrTextureProxy> subsetProxy(
@@ -518,12 +521,14 @@
             SkASSERT(subsetProxy->priv().isExact());
             // MDB: this is acceptable (wrapping subsetProxy in an SkImage) bc Copy will
             // return a kExact-backed proxy
-            return wrap_proxy_in_image(fContext, std::move(subsetProxy), fAlphaType, fColorSpace);
+            return wrap_proxy_in_image(fContext, std::move(subsetProxy), this->colorType(),
+                                       fAlphaType, fColorSpace);
         }
 
         fTextureProxy->priv().exactify(true);
 
-        return wrap_proxy_in_image(fContext, fTextureProxy, fAlphaType, fColorSpace);
+        return wrap_proxy_in_image(fContext, fTextureProxy, this->colorType(), fAlphaType,
+                                   fColorSpace);
     }
 
     sk_sp<SkSurface> onMakeTightSurface(SkColorType colorType, const SkColorSpace* colorSpace,
diff --git a/src/gpu/GrContextPriv.cpp b/src/gpu/GrContextPriv.cpp
index 7fd443b..e033ffa 100644
--- a/src/gpu/GrContextPriv.cpp
+++ b/src/gpu/GrContextPriv.cpp
@@ -131,9 +131,10 @@
         return nullptr;
     }
 
+    SkColorType colorType = GrColorTypeToSkColorType(GrMaskFormatToColorType(format));
     SkASSERT(views[index].proxy()->priv().isExact());
     sk_sp<SkImage> image(new SkImage_Gpu(sk_ref_sp(fContext), kNeedNewImageUniqueID,
-                                         kPremul_SkAlphaType, views[index], nullptr));
+                                         views[index], colorType, kPremul_SkAlphaType, nullptr));
     return image;
 }
 
diff --git a/src/gpu/text/GrAtlasManager.cpp b/src/gpu/text/GrAtlasManager.cpp
index 978ac45..a4efc51 100644
--- a/src/gpu/text/GrAtlasManager.cpp
+++ b/src/gpu/text/GrAtlasManager.cpp
@@ -22,20 +22,6 @@
 
 GrAtlasManager::~GrAtlasManager() = default;
 
-static GrColorType mask_format_to_gr_color_type(GrMaskFormat format) {
-    switch (format) {
-        case kA8_GrMaskFormat:
-            return GrColorType::kAlpha_8;
-        case kA565_GrMaskFormat:
-            return GrColorType::kBGR_565;
-        case kARGB_GrMaskFormat:
-            return GrColorType::kRGBA_8888;
-        default:
-            SkDEBUGFAIL("unsupported GrMaskFormat");
-            return GrColorType::kAlpha_8;
-    }
-}
-
 void GrAtlasManager::freeAll() {
     for (int i = 0; i < kMaskFormatCount; ++i) {
         fAtlases[i] = nullptr;
@@ -141,7 +127,7 @@
 #else
                 filename.printf("fontcache_%d%d%d.png", gDumpCount, i, pageIdx);
 #endif
-                auto ct = mask_format_to_gr_color_type(AtlasIndexToMaskFormat(i));
+                auto ct = GrMaskFormatToColorType(AtlasIndexToMaskFormat(i));
                 save_pixels(context, views[pageIdx], ct, filename.c_str());
             }
         }
@@ -164,7 +150,7 @@
 bool GrAtlasManager::initAtlas(GrMaskFormat format) {
     int index = MaskFormatToAtlasIndex(format);
     if (fAtlases[index] == nullptr) {
-        GrColorType grColorType = mask_format_to_gr_color_type(format);
+        GrColorType grColorType = GrMaskFormatToColorType(format);
         SkISize atlasDimensions = fAtlasConfig.atlasDimensions(format);
         SkISize plotDimensions = fAtlasConfig.plotDimensions(format);
 
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 6d2a48f..a431daf 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -45,19 +45,23 @@
 #include "src/gpu/gl/GrGLTexture.h"
 #include "src/image/SkImage_Gpu.h"
 
-static SkColorType proxy_color_type(GrSurfaceProxy* proxy) {
-    SkColorType colorType;
-    if (!GrPixelConfigToColorType(proxy->config(), &colorType)) {
-        colorType = kUnknown_SkColorType;
-    }
-    return colorType;
-}
-
-SkImage_Gpu::SkImage_Gpu(sk_sp<GrContext> context, uint32_t uniqueID, SkAlphaType at,
-                         GrSurfaceProxyView view, sk_sp<SkColorSpace> colorSpace)
+SkImage_Gpu::SkImage_Gpu(sk_sp<GrContext> context, uint32_t uniqueID, GrSurfaceProxyView view,
+                         SkColorType ct, SkAlphaType at, sk_sp<SkColorSpace> colorSpace)
         : INHERITED(std::move(context), view.proxy()->backingStoreDimensions(), uniqueID,
-                    proxy_color_type(view.proxy()), at, colorSpace)
-        , fView(std::move(view)) {}
+                    ct, at, colorSpace)
+        , fView(std::move(view)) {
+#ifdef SK_DEBUG
+    const GrBackendFormat& format = fView.proxy()->backendFormat();
+    GrColorType grCT = SkColorTypeToGrColorType(ct);
+    const GrCaps* caps = this->context()->priv().caps();
+    if (caps->isFormatSRGB(format)) {
+        SkASSERT(grCT == GrColorType::kRGBA_8888);
+        grCT = GrColorType::kRGBA_8888_SRGB;
+    }
+    SkASSERT(caps->isFormatCompressed(format) ||
+             caps->areColorTypeAndFormatCompatible(grCT, format));
+#endif
+}
 
 SkImage_Gpu::~SkImage_Gpu() {}
 
@@ -102,14 +106,16 @@
         return nullptr;
     }
 
+    targetCT = GrColorTypeToSkColorType(renderTargetContext->colorInfo().colorType());
     // MDB: this call is okay bc we know 'renderTargetContext' was exact
-    return sk_make_sp<SkImage_Gpu>(fContext, kNeedNewImageUniqueID, this->alphaType(),
-                                   renderTargetContext->readSurfaceView(), std::move(targetCS));
+    return sk_make_sp<SkImage_Gpu>(fContext, kNeedNewImageUniqueID,
+                                   renderTargetContext->readSurfaceView(), targetCT,
+                                   this->alphaType(), std::move(targetCS));
 }
 
 sk_sp<SkImage> SkImage_Gpu::onReinterpretColorSpace(sk_sp<SkColorSpace> newCS) const {
-    return sk_make_sp<SkImage_Gpu>(fContext, kNeedNewImageUniqueID, this->alphaType(), fView,
-                                   std::move(newCS));
+    return sk_make_sp<SkImage_Gpu>(fContext, kNeedNewImageUniqueID, fView, this->colorType(),
+                                   this->alphaType(), std::move(newCS));
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -136,8 +142,8 @@
 
     GrSwizzle swizzle = ctx->priv().caps()->getReadSwizzle(proxy->backendFormat(), colorType);
     GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
-    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(ctx), kNeedNewImageUniqueID, at, std::move(view),
-                                   std::move(colorSpace));
+    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(ctx), kNeedNewImageUniqueID, std::move(view),
+                                   GrColorTypeToSkColorType(colorType), at, std::move(colorSpace));
 }
 
 sk_sp<SkImage> SkImage::MakeFromCompressedTexture(GrContext* ctx,
@@ -165,8 +171,11 @@
         return nullptr;
     }
 
+    CompressionType type = caps->compressionType(tex.getBackendFormat());
+    SkColorType ct = GrCompressionTypeToSkColorType(type);
+
     GrSurfaceProxyView view(std::move(proxy), origin, GrSwizzle::RGBA());
-    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(ctx), kNeedNewImageUniqueID, at, std::move(view),
+    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(ctx), kNeedNewImageUniqueID,  std::move(view), ct, at,
                                    std::move(cs));
 }
 
@@ -231,8 +240,10 @@
     SkASSERT(proxy->textureSwizzle() == GrSwizzle());
     GrSurfaceProxyView view(std::move(proxy));
 
-    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(context), kNeedNewImageUniqueID, kOpaque_SkAlphaType,
-                                   std::move(view), nullptr);
+    SkColorType colorType = GrCompressionTypeToSkColorType(type);
+
+    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(context), kNeedNewImageUniqueID, std::move(view),
+                                   colorType, kOpaque_SkAlphaType, nullptr);
 }
 
 sk_sp<SkImage> SkImage_Gpu::ConvertYUVATexturesToRGB(GrContext* ctx, SkYUVColorSpace yuvColorSpace,
@@ -259,10 +270,11 @@
         return nullptr;
     }
 
+    SkColorType ct = GrColorTypeToSkColorType(renderTargetContext->colorInfo().colorType());
     SkAlphaType at = GetAlphaTypeFromYUVAIndices(yuvaIndices);
     // MDB: this call is okay bc we know 'renderTargetContext' was exact
-    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(ctx), kNeedNewImageUniqueID, at,
-                                   renderTargetContext->readSurfaceView(),
+    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(ctx), kNeedNewImageUniqueID,
+                                   renderTargetContext->readSurfaceView(), ct, at,
                                    renderTargetContext->colorInfo().refColorSpace());
 }
 
@@ -388,8 +400,7 @@
 }
 
 static sk_sp<SkImage> create_image_from_producer(GrContext* context, GrTextureProducer* producer,
-                                                 SkAlphaType at, uint32_t id,
-                                                 GrMipMapped mipMapped) {
+                                                 uint32_t id, GrMipMapped mipMapped) {
     // TODO: have texture producer return a GrSurfaceProxyView
     auto [proxy, colorType] = producer->refTextureProxy(mipMapped);
     if (!proxy) {
@@ -398,8 +409,9 @@
     GrSurfaceOrigin origin = proxy->origin();
     const GrSwizzle& swizzle = proxy->textureSwizzle();
     GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
-    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(context), id, at, std::move(view),
-                                   sk_ref_sp(producer->colorSpace()));
+    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(context), id, std::move(view),
+                                   GrColorTypeToSkColorType(colorType),
+                                   producer->alphaType(), sk_ref_sp(producer->colorSpace()));
 }
 
 sk_sp<SkImage> SkImage::makeTextureImage(GrContext* context, GrMipMapped mipMapped) const {
@@ -419,20 +431,17 @@
         }
         GrTextureAdjuster adjuster(context, std::move(proxy), this->imageInfo().colorInfo(),
                                    this->uniqueID());
-        return create_image_from_producer(context, &adjuster, this->alphaType(),
-                                          this->uniqueID(), mipMapped);
+        return create_image_from_producer(context, &adjuster, this->uniqueID(), mipMapped);
     }
 
     if (this->isLazyGenerated()) {
         GrImageTextureMaker maker(context, this, kDisallow_CachingHint);
-        return create_image_from_producer(context, &maker, this->alphaType(),
-                                          this->uniqueID(), mipMapped);
+        return create_image_from_producer(context, &maker, this->uniqueID(), mipMapped);
     }
 
     if (const SkBitmap* bmp = as_IB(this)->onPeekBitmap()) {
         GrBitmapTextureMaker maker(context, *bmp);
-        return create_image_from_producer(context, &maker, this->alphaType(),
-                                          this->uniqueID(), mipMapped);
+        return create_image_from_producer(context, &maker, this->uniqueID(), mipMapped);
     }
     return nullptr;
 }
@@ -491,8 +500,8 @@
     }
     GrSwizzle swizzle = context->priv().caps()->getReadSwizzle(backendFormat, grColorType);
     GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
-    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(context), kNeedNewImageUniqueID, alphaType,
-                                   std::move(view), std::move(colorSpace));
+    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(context), kNeedNewImageUniqueID, std::move(view),
+                                   colorType, alphaType, std::move(colorSpace));
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -624,8 +633,8 @@
 
     GrSwizzle swizzle = context->priv().caps()->getReadSwizzle(backendFormat, grColorType);
     GrSurfaceProxyView view(std::move(proxy), surfaceOrigin, swizzle);
-    sk_sp<SkImage> image = sk_make_sp<SkImage_Gpu>(sk_ref_sp(context), kNeedNewImageUniqueID, at,
-                                                   view, cs);
+    sk_sp<SkImage> image = sk_make_sp<SkImage_Gpu>(sk_ref_sp(context), kNeedNewImageUniqueID, view,
+                                                   colorType, at, cs);
     if (!image) {
         return nullptr;
     }
diff --git a/src/image/SkImage_Gpu.h b/src/image/SkImage_Gpu.h
index dde775b..75a830a 100644
--- a/src/image/SkImage_Gpu.h
+++ b/src/image/SkImage_Gpu.h
@@ -23,7 +23,7 @@
 
 class SkImage_Gpu : public SkImage_GpuBase {
 public:
-    SkImage_Gpu(sk_sp<GrContext>, uint32_t uniqueID, SkAlphaType, GrSurfaceProxyView,
+    SkImage_Gpu(sk_sp<GrContext>, uint32_t uniqueID, GrSurfaceProxyView, SkColorType, SkAlphaType,
                 sk_sp<SkColorSpace>);
     ~SkImage_Gpu() override;
 
diff --git a/src/image/SkImage_GpuBase.cpp b/src/image/SkImage_GpuBase.cpp
index 309d596..347903b 100644
--- a/src/image/SkImage_GpuBase.cpp
+++ b/src/image/SkImage_GpuBase.cpp
@@ -161,8 +161,8 @@
 
     GrSurfaceProxyView view(std::move(copyProxy), currView.origin(), currView.swizzle());
     // MDB: this call is okay bc we know 'sContext' was kExact
-    return sk_make_sp<SkImage_Gpu>(fContext, kNeedNewImageUniqueID, this->alphaType(),
-                                   std::move(view), this->refColorSpace());
+    return sk_make_sp<SkImage_Gpu>(fContext, kNeedNewImageUniqueID, std::move(view),
+                                   this->colorType(), this->alphaType(), this->refColorSpace());
 }
 
 bool SkImage_GpuBase::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRB,
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 1ce11f2..1302f82 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -123,8 +123,8 @@
         // above copy creates a kExact surfaceContext.
         SkASSERT(srcProxy->priv().isExact());
         GrSurfaceProxyView view(std::move(srcProxy), rtc->origin(), rtc->readSwizzle());
-        image = sk_make_sp<SkImage_Gpu>(sk_ref_sp(ctx), kNeedNewImageUniqueID, info.alphaType(),
-                                        std::move(view), info.refColorSpace());
+        image = sk_make_sp<SkImage_Gpu>(sk_ref_sp(ctx), kNeedNewImageUniqueID, std::move(view),
+                                        info.colorType(), info.alphaType(), info.refColorSpace());
     }
     return image;
 }
@@ -258,8 +258,8 @@
         const SkImageInfo info = fDevice->imageInfo();
         GrSurfaceProxyView view(std::move(srcProxy), rtc->origin(), rtc->readSwizzle());
         sk_sp<SkImage> image;
-        image = sk_make_sp<SkImage_Gpu>(sk_ref_sp(context), kNeedNewImageUniqueID, info.alphaType(),
-                                        std::move(view), info.refColorSpace());
+        image = sk_make_sp<SkImage_Gpu>(sk_ref_sp(context), kNeedNewImageUniqueID, std::move(view),
+                                        info.colorType(), info.alphaType(), info.refColorSpace());
         canvas->drawImage(image, x, y, paint);
         return true;
     };