Fix-up colorSpace-less decodes

Follow-up to https://skia-review.googlesource.com/c/skia/+/156627

When attempting to decode into an SkImageInfo without an SkColorSpace,
assume it is SRGB. This updates scanline and incremental decodes to do
so just like getPixels does.

Bug: skia:8382
Change-Id: Ife3c44088be4065c065d7682fe1cb0dc1dd6376f
Reviewed-on: https://skia-review.googlesource.com/c/159325
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp
index 73a6a29..f9c34dd 100644
--- a/src/codec/SkCodec.cpp
+++ b/src/codec/SkCodec.cpp
@@ -372,10 +372,14 @@
     return result;
 }
 
-SkCodec::Result SkCodec::startIncrementalDecode(const SkImageInfo& info, void* pixels,
+SkCodec::Result SkCodec::startIncrementalDecode(const SkImageInfo& dstInfo, void* pixels,
         size_t rowBytes, const SkCodec::Options* options) {
     fStartedIncrementalDecode = false;
 
+    SkImageInfo info = dstInfo;
+    if (!info.colorSpace()) {
+        info = info.makeColorSpace(SkColorSpace::MakeSRGB());
+    }
     if (kUnknown_SkColorType == info.colorType()) {
         return kInvalidConversion;
     }
@@ -441,11 +445,16 @@
 }
 
 
-SkCodec::Result SkCodec::startScanlineDecode(const SkImageInfo& info,
+SkCodec::Result SkCodec::startScanlineDecode(const SkImageInfo& dstInfo,
         const SkCodec::Options* options) {
     // Reset fCurrScanline in case of failure.
     fCurrScanline = -1;
 
+    SkImageInfo info = dstInfo;
+    if (!info.colorSpace()) {
+        info = info.makeColorSpace(SkColorSpace::MakeSRGB());
+    }
+
     if (!this->rewindIfNeeded()) {
         return kCouldNotRewind;
     }