Index8 is dead, remove guarded code

Needs google3 to be updated before this can land.

Bug: skia:6828
Change-Id: I2c16be13c6937ffa48768cc24f9f980171c824d6
Reviewed-on: https://skia-review.googlesource.com/23940
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 10d1c25..bcb77f6 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -121,11 +121,6 @@
     /** Return true iff drawing this bitmap has no effect.
      */
     bool drawsNothing() const {
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        if (this->colorType() == kIndex_8_SkColorType) {
-            return true;
-        }
-#endif
         return this->empty() || this->isNull();
     }
 
@@ -429,11 +424,6 @@
         non-null colortable. Returns true if all of the above are met.
     */
     bool readyToDraw() const {
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        if (this->colorType() == kIndex_8_SkColorType) {
-            return false;
-        }
-#endif
         return this->getPixels() != NULL;
     }
 
@@ -734,14 +724,4 @@
     return (uint8_t*)fPixels + y * fRowBytes + x;
 }
 
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const {
-    SkASSERT(fPixels);
-    SkASSERT(kIndex_8_SkColorType == this->colorType());
-    SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)this->height());
-    SkASSERT(this->getColorTable());
-    return (*this->getColorTable())[*((const uint8_t*)fPixels + y * fRowBytes + x)];
-}
-#endif
-
 #endif
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h
index 551eb86..d3cbda3 100644
--- a/include/core/SkImageInfo.h
+++ b/include/core/SkImageInfo.h
@@ -72,9 +72,6 @@
     kARGB_4444_SkColorType,
     kRGBA_8888_SkColorType,
     kBGRA_8888_SkColorType,
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    kIndex_8_SkColorType,
-#endif
     kGray_8_SkColorType,
     kRGBA_F16_SkColorType,
 
@@ -97,9 +94,6 @@
         2,  // ARGB_4444
         4,  // RGBA_8888
         4,  // BGRA_8888
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        1,  // kIndex_8
-#endif
         1,  // kGray_8
         8,  // kRGBA_F16
     };
@@ -118,9 +112,6 @@
         1,  // ARGB_4444
         2,  // RGBA_8888
         2,  // BGRA_8888
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        0,  // kIndex_8
-#endif
         0,  // kGray_8
         3,  // kRGBA_F16
     };
diff --git a/include/core/SkPixmap.h b/include/core/SkPixmap.h
index be821ec..9ad04c1 100644
--- a/include/core/SkPixmap.h
+++ b/include/core/SkPixmap.h
@@ -30,14 +30,7 @@
              SkColorTable* ctable = NULL)
         : fPixels(addr), fCTable(ctable), fRowBytes(rowBytes), fInfo(info)
     {
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        if (kIndex_8_SkColorType == info.colorType()) {
-            SkASSERT(ctable);
-        } else
-#endif
-        {
-            SkASSERT(NULL == ctable);
-        }
+        SkASSERT(NULL == ctable);
     }
 
     void reset();
diff --git a/src/android/SkBitmapRegionCodec.cpp b/src/android/SkBitmapRegionCodec.cpp
index 52774bc..8944951 100644
--- a/src/android/SkBitmapRegionCodec.cpp
+++ b/src/android/SkBitmapRegionCodec.cpp
@@ -57,10 +57,6 @@
     SkImageInfo decodeInfo = SkImageInfo::Make(scaledSize.width(), scaledSize.height(),
                                                dstColorType, dstAlphaType, dstColorSpace);
 
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    SkASSERT(dstColorType != kIndex_8_SkColorType);
-#endif
-
     // Initialize the destination bitmap
     int scaledOutX = 0;
     int scaledOutY = 0;
diff --git a/src/codec/SkAndroidCodec.cpp b/src/codec/SkAndroidCodec.cpp
index 97be146..0245ea2 100644
--- a/src/codec/SkAndroidCodec.cpp
+++ b/src/codec/SkAndroidCodec.cpp
@@ -110,9 +110,6 @@
         case kARGB_4444_SkColorType:
             return kN32_SkColorType;
         case kN32_SkColorType:
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-#endif
             break;
         case kAlpha_8_SkColorType:
             // Fall through to kGray_8.  Before kGray_8_SkColorType existed,
@@ -148,9 +145,6 @@
 sk_sp<SkColorSpace> SkAndroidCodec::computeOutputColorSpace(SkColorType outputColorType,
                                                             sk_sp<SkColorSpace> prefColorSpace) {
     switch (outputColorType) {
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-#endif
         case kRGBA_8888_SkColorType:
         case kBGRA_8888_SkColorType: {
             // If |prefColorSpace| is supported, choose it.
diff --git a/src/codec/SkCodecImageGenerator.cpp b/src/codec/SkCodecImageGenerator.cpp
index 79cb253..7be6277 100644
--- a/src/codec/SkCodecImageGenerator.cpp
+++ b/src/codec/SkCodecImageGenerator.cpp
@@ -22,12 +22,6 @@
     if (kUnpremul_SkAlphaType == info.alphaType()) {
         newInfo = newInfo.makeAlphaType(kPremul_SkAlphaType);
     }
-
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    if (kIndex_8_SkColorType == info.colorType()) {
-        newInfo = newInfo.makeColorType(kN32_SkColorType);
-    }
-#endif
     return newInfo;
 }
 
diff --git a/src/codec/SkSampler.cpp b/src/codec/SkSampler.cpp
index 0dbe320..c7d9a3a 100644
--- a/src/codec/SkSampler.cpp
+++ b/src/codec/SkSampler.cpp
@@ -57,11 +57,6 @@
             }
             break;
         }
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-            // On an index destination color type, always assume the input is an index.
-            // Fall through
-#endif
         case kGray_8_SkColorType:
             // If the destination is kGray, the caller passes in an 8-bit color.
             // We will not assert that the high bits of colorOrIndex must be zeroed.
diff --git a/src/codec/SkSwizzler.cpp b/src/codec/SkSwizzler.cpp
index c19dd05..f77d7fa 100644
--- a/src/codec/SkSwizzler.cpp
+++ b/src/codec/SkSwizzler.cpp
@@ -104,29 +104,6 @@
 #undef GRAYSCALE_BLACK
 #undef GRAYSCALE_WHITE
 
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-// same as swizzle_bit_to_grayscale and swizzle_bit_to_n32 except for value assigned to dst[x]
-static void swizzle_bit_to_index(
-        void* SK_RESTRICT dstRow, const uint8_t* SK_RESTRICT src, int dstWidth,
-        int bpp, int deltaSrc, int offset, const SkPMColor* /*ctable*/) {
-    uint8_t* SK_RESTRICT dst = (uint8_t*) dstRow;
-
-    // increment src by byte offset and bitIndex by bit offset
-    src += offset / 8;
-    int bitIndex = offset % 8;
-    uint8_t currByte = *src;
-
-    dst[0] = ((currByte >> (7-bitIndex)) & 1);
-
-    for (int x = 1; x < dstWidth; x++) {
-        int bitOffset = bitIndex + deltaSrc;
-        bitIndex = bitOffset % 8;
-        currByte = *(src += bitOffset / 8);
-        dst[x] = ((currByte >> (7-bitIndex)) & 1);
-    }
-}
-#endif
-
 // same as swizzle_bit_to_grayscale and swizzle_bit_to_index except for value assigned to dst[x]
 static void swizzle_bit_to_n32(
         void* SK_RESTRICT dstRow, const uint8_t* SK_RESTRICT src, int dstWidth,
@@ -205,29 +182,6 @@
 
 // kIndex1, kIndex2, kIndex4
 
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-static void swizzle_small_index_to_index(
-        void* SK_RESTRICT dstRow, const uint8_t* SK_RESTRICT src, int dstWidth,
-        int bpp, int deltaSrc, int offset, const SkPMColor ctable[]) {
-
-    uint8_t* dst = (uint8_t*) dstRow;
-    src += offset / 8;
-    int bitIndex = offset % 8;
-    uint8_t currByte = *src;
-    const uint8_t mask = (1 << bpp) - 1;
-    uint8_t index = (currByte >> (8 - bpp - bitIndex)) & mask;
-    dst[0] = index;
-
-    for (int x = 1; x < dstWidth; x++) {
-        int bitOffset = bitIndex + deltaSrc;
-        bitIndex = bitOffset % 8;
-        currByte = *(src += bitOffset / 8);
-        index = (currByte >> (8 - bpp - bitIndex)) & mask;
-        dst[x] = index;
-    }
-}
-#endif
-
 static void swizzle_small_index_to_565(
         void* SK_RESTRICT dstRow, const uint8_t* SK_RESTRICT src, int dstWidth,
         int bpp, int deltaSrc, int offset, const SkPMColor ctable[]) {
@@ -891,11 +845,6 @@
                             case kBGRA_8888_SkColorType:
                                 proc = &swizzle_bit_to_n32;
                                 break;
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-                            case kIndex_8_SkColorType:
-                                proc = &swizzle_bit_to_index;
-                                break;
-#endif
                             case kRGB_565_SkColorType:
                                 proc = &swizzle_bit_to_565;
                                 break;
@@ -976,11 +925,6 @@
                             case kRGB_565_SkColorType:
                                 proc = &swizzle_small_index_to_565;
                                 break;
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-                            case kIndex_8_SkColorType:
-                                proc = &swizzle_small_index_to_index;
-                                break;
-#endif
                             default:
                                 return nullptr;
                         }
@@ -998,12 +942,6 @@
                             case kRGB_565_SkColorType:
                                 proc = &swizzle_index_to_565;
                                 break;
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-                            case kIndex_8_SkColorType:
-                                proc = &sample1;
-                                fastProc = &copy;
-                                break;
-#endif
                             default:
                                 return nullptr;
                         }
diff --git a/src/codec/SkWbmpCodec.cpp b/src/codec/SkWbmpCodec.cpp
index 9a0ed6e..eea5e4b 100644
--- a/src/codec/SkWbmpCodec.cpp
+++ b/src/codec/SkWbmpCodec.cpp
@@ -25,9 +25,6 @@
     switch (dstInfo.colorType()) {
         case kRGBA_8888_SkColorType:
         case kBGRA_8888_SkColorType:
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-#endif
         case kGray_8_SkColorType:
         case kRGB_565_SkColorType:
             return true;
diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp
index 8d3d8cc..a2981ca 100644
--- a/src/codec/SkWebpCodec.cpp
+++ b/src/codec/SkWebpCodec.cpp
@@ -328,9 +328,6 @@
         case kUnknown_SkColorType:
         case kAlpha_8_SkColorType:
         case kARGB_4444_SkColorType:
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-#endif
         case kGray_8_SkColorType:
             SkASSERT(false);
             break;
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 8f8d70f..e3ce283 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -242,11 +242,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 bool SkBitmap::tryAllocPixels(const SkImageInfo& requestedInfo, size_t rowBytes) {
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    if (kIndex_8_SkColorType == requestedInfo.colorType()) {
-        return reset_return_false(this);
-    }
-#endif
     if (!this->setInfo(requestedInfo, rowBytes)) {
         return reset_return_false(this);
     }
@@ -270,11 +265,6 @@
 
 bool SkBitmap::tryAllocPixels(const SkImageInfo& requestedInfo, sk_sp<SkColorTable> ctable,
                               uint32_t allocFlags) {
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    if (kIndex_8_SkColorType == requestedInfo.colorType() && nullptr == ctable) {
-        return reset_return_false(this);
-    }
-#endif
     if (!this->setInfo(requestedInfo)) {
         return reset_return_false(this);
     }
@@ -432,9 +422,6 @@
                 base += x << 1;
                 break;
             case kAlpha_8_SkColorType:
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-            case kIndex_8_SkColorType:
-#endif
             case kGray_8_SkColorType:
                 base += x;
                 break;
@@ -455,9 +442,6 @@
 
     switch (fInfo.colorType()) {
         case kUnknown_SkColorType:
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-#endif
             // TODO: can we ASSERT that we never get here?
             return; // can't erase. Should we bzero so the memory is not uninitialized?
         default:
@@ -658,17 +642,8 @@
         src += ramRB;
     }
     buffer->writeByteArray(storage.get(), size);
-
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    const SkColorTable* ct = pmap.ctable();
-    if (kIndex_8_SkColorType == info.colorType() && ct) {
-        buffer->writeBool(true);
-        ct->writeToBuffer(*buffer);
-    } else
-#endif
-    {
-        buffer->writeBool(false);
-    }
+    // no colortable
+    buffer->writeBool(false);
 }
 
 void SkBitmap::WriteRawPixels(SkWriteBuffer* buffer, const SkBitmap& bitmap) {
diff --git a/src/core/SkBlitter_Sprite.cpp b/src/core/SkBlitter_Sprite.cpp
index ff7d466..9f34391 100644
--- a/src/core/SkBlitter_Sprite.cpp
+++ b/src/core/SkBlitter_Sprite.cpp
@@ -104,15 +104,6 @@
         , fSrcPtr(nullptr)
     {}
 
-    static bool Supports(const SkPixmap& src) {
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        // We'd need to add a load_i8 stage.
-        return src.colorType() != kIndex_8_SkColorType;
-#else
-        return true;
-#endif
-    }
-
     void setup(const SkPixmap& dst, int left, int top, const SkPaint& paint) override {
         fDst  = dst;
         fLeft = left;
@@ -198,7 +189,7 @@
     if (!blitter && !dst.colorSpace() && dst.colorType() == kN32_SkColorType) {
         blitter = SkSpriteBlitter::ChooseL32(source, paint, allocator);
     }
-    if (!blitter && SkRasterPipelineSpriteBlitter::Supports(source)) {
+    if (!blitter) {
         blitter = allocator->make<SkRasterPipelineSpriteBlitter>(source, allocator);
     }
 
diff --git a/src/core/SkConvertPixels.cpp b/src/core/SkConvertPixels.cpp
index 2f4c889..f7c6f24 100644
--- a/src/core/SkConvertPixels.cpp
+++ b/src/core/SkConvertPixels.cpp
@@ -243,21 +243,6 @@
             }
             break;
         }
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType: {
-            SkASSERT(ctable);
-            const uint32_t* table = ctable->readColors();
-            auto src8 = (const uint8_t*)src;
-            for (int y = 0; y < srcInfo.height(); y++) {
-                for (int x = 0; x < srcInfo.width(); x++) {
-                    dst[x] = table[src8[x]] >> 24;
-                }
-                dst = SkTAddOffset<uint8_t>(dst, dstRB);
-                src8 = SkTAddOffset<const uint8_t>(src8, srcRB);
-            }
-            break;
-        }
-#endif
         case kRGBA_F16_SkColorType: {
             auto src64 = (const uint64_t*) src;
             for (int y = 0; y < srcInfo.height(); y++) {
@@ -430,16 +415,6 @@
         return;
     }
 
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    // Fast Path 4: Index 8 sources.
-    if (kIndex_8_SkColorType == srcInfo.colorType()) {
-        SkASSERT(ctable);
-        convert_from_index8(dstInfo, dstPixels, dstRB, srcInfo, (const uint8_t*) srcPixels, srcRB,
-                            ctable, behavior);
-        return;
-    }
-#endif
-
     // Fast Path 5: Alpha 8 dsts.
     if (kAlpha_8_SkColorType == dstInfo.colorType()) {
         convert_to_alpha8((uint8_t*) dstPixels, dstRB, srcInfo, srcPixels, srcRB, ctable);
diff --git a/src/core/SkImageGenerator.cpp b/src/core/SkImageGenerator.cpp
index 7ce944b..a3e8253 100644
--- a/src/core/SkImageGenerator.cpp
+++ b/src/core/SkImageGenerator.cpp
@@ -19,11 +19,6 @@
     if (kUnknown_SkColorType == info.colorType()) {
         return false;
     }
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    if (kIndex_8_SkColorType == info.colorType()) {
-        return false;
-    }
-#endif
     if (nullptr == pixels) {
         return false;
     }
diff --git a/src/core/SkImageInfo.cpp b/src/core/SkImageInfo.cpp
index 90d174d..8006441 100644
--- a/src/core/SkImageInfo.cpp
+++ b/src/core/SkImageInfo.cpp
@@ -46,9 +46,6 @@
     kARGB_4444_Stored_SkColorType,
     kRGBA_8888_Stored_SkColorType,
     kBGRA_8888_Stored_SkColorType,
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    kIndex_8_Stored_SkColorType_DEPRECATED,
-#endif
     kGray_8_Stored_SkColorType,
     kRGBA_F16_Stored_SkColorType,
 };
@@ -135,9 +132,6 @@
                 alphaType = kPremul_SkAlphaType;
             }
             // fall-through
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-#endif
         case kARGB_4444_SkColorType:
         case kRGBA_8888_SkColorType:
         case kBGRA_8888_SkColorType:
diff --git a/src/core/SkImageInfoPriv.h b/src/core/SkImageInfoPriv.h
index 43680ad..38de97f 100644
--- a/src/core/SkImageInfoPriv.h
+++ b/src/core/SkImageInfoPriv.h
@@ -111,24 +111,6 @@
         return false;
     }
 
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    if (kIndex_8_SkColorType == dst.colorType()) {
-        if (kIndex_8_SkColorType != src.colorType()) {
-            return false;
-        }
-
-        if ((kPremul_SkAlphaType == dst.alphaType() && kUnpremul_SkAlphaType == src.alphaType()) ||
-            (kUnpremul_SkAlphaType == dst.alphaType() && kPremul_SkAlphaType == src.alphaType()))
-        {
-            return false;
-        }
-
-        if (dst.colorSpace() && !SkColorSpace::Equals(dst.colorSpace(), src.colorSpace())) {
-            return false;
-        }
-    }
-#endif
-
     if (kGray_8_SkColorType == dst.colorType()) {
         if (kGray_8_SkColorType != src.colorType()) {
             return false;
diff --git a/src/core/SkLinearBitmapPipeline.cpp b/src/core/SkLinearBitmapPipeline.cpp
index 8c4d062..07679e3 100644
--- a/src/core/SkLinearBitmapPipeline.cpp
+++ b/src/core/SkLinearBitmapPipeline.cpp
@@ -372,11 +372,6 @@
 
     // If it is an index 8 color type, the sampler converts to unpremul for better fidelity.
     SkAlphaType alphaType = srcImageInfo.alphaType();
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    if (srcPixmap.colorType() == kIndex_8_SkColorType) {
-        alphaType = kUnpremul_SkAlphaType;
-    }
-#endif
 
     float postAlpha = SkColorGetA(paintColor) * (1.0f / 255.0f);
     // As the stages are built, the chooser function may skip a stage. For example, with the
@@ -598,10 +593,6 @@
             return this->chooseSpecificAccessor<kRGBA_8888_SkColorType>(srcPixmap, allocator);
         case kBGRA_8888_SkColorType:
             return this->chooseSpecificAccessor<kBGRA_8888_SkColorType>(srcPixmap, allocator);
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-            return this->chooseSpecificAccessor<kIndex_8_SkColorType>(srcPixmap, allocator);
-#endif
         case kGray_8_SkColorType:
             return this->chooseSpecificAccessor<kGray_8_SkColorType>(srcPixmap, allocator);
         case kRGBA_F16_SkColorType: {
@@ -636,14 +627,6 @@
                         PixelAccessor<kN32_SkColorType, kSRGB_SkGammaType>, Blender>;
                     return allocator->make<Sampler>(next, srcPixmap);
                 }
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-                case kIndex_8_SkColorType: {
-                    using Sampler =
-                    NearestNeighborSampler<
-                        PixelAccessor<kIndex_8_SkColorType, kSRGB_SkGammaType>, Blender>;
-                    return allocator->make<Sampler>(next, srcPixmap);
-                }
-#endif
                 default:
                     break;
             }
@@ -655,14 +638,6 @@
                         PixelAccessor<kN32_SkColorType, kSRGB_SkGammaType>, Blender>;
                     return allocator->make<Sampler>(next, dimensions, xTile, yTile, srcPixmap);
                 }
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-                case kIndex_8_SkColorType: {
-                    using Sampler =
-                    BilerpSampler<
-                        PixelAccessor<kIndex_8_SkColorType, kSRGB_SkGammaType>, Blender>;
-                    return allocator->make<Sampler>(next, dimensions, xTile, yTile, srcPixmap);
-                }
-#endif
                 default:
                     break;
             }
diff --git a/src/core/SkLinearBitmapPipeline_sample.h b/src/core/SkLinearBitmapPipeline_sample.h
index 7459978..4238931 100644
--- a/src/core/SkLinearBitmapPipeline_sample.h
+++ b/src/core/SkLinearBitmapPipeline_sample.h
@@ -132,42 +132,6 @@
                    gammaType == kSRGB_SkGammaType ? Sk4f_fromS32(pixel) : Sk4f_fromL32(pixel));
     }
 };
-
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-template <SkGammaType gammaType>
-class PixelConverter<kIndex_8_SkColorType, gammaType> {
-public:
-    using Element = uint8_t;
-    PixelConverter(const SkPixmap& srcPixmap)
-    : fColorTableSize(srcPixmap.ctable()->count()){
-        SkColorTable* skColorTable = srcPixmap.ctable();
-        SkASSERT(skColorTable != nullptr);
-
-        fColorTable = (Sk4f*)SkAlign16((intptr_t)fColorTableStorage.get());
-        for (int i = 0; i < fColorTableSize; i++) {
-            fColorTable[i] = pmcolor_to_rgba<gammaType>((*skColorTable)[i]);
-        }
-    }
-
-    PixelConverter(const PixelConverter& strategy)
-    : fColorTableSize{strategy.fColorTableSize}{
-        fColorTable = (Sk4f*)SkAlign16((intptr_t)fColorTableStorage.get());
-        for (int i = 0; i < fColorTableSize; i++) {
-            fColorTable[i] = strategy.fColorTable[i];
-        }
-    }
-
-    Sk4f toSk4f(Element index) const {
-        return fColorTable[index];
-    }
-
-private:
-    static const size_t kColorTableSize = sizeof(Sk4f[256]) + 12;
-    const int           fColorTableSize;
-    SkAutoMalloc        fColorTableStorage{kColorTableSize};
-    Sk4f*               fColorTable;
-};
-#endif
     
 template <SkGammaType gammaType>
 class PixelConverter<kGray_8_SkColorType, gammaType> {
diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp
index ce1c6c1..bda14bb 100644
--- a/src/core/SkMallocPixelRef.cpp
+++ b/src/core/SkMallocPixelRef.cpp
@@ -144,14 +144,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 static sk_sp<SkColorTable> sanitize(const SkImageInfo& info, sk_sp<SkColorTable> ctable) {
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    if (kIndex_8_SkColorType == info.colorType()) {
-        SkASSERT(ctable);
-    } else
-#endif
-    {
-        ctable.reset(nullptr);
-    }
+    ctable.reset(nullptr);
     return ctable;
 }
 
diff --git a/src/core/SkPixmap.cpp b/src/core/SkPixmap.cpp
index cbb40a8..d62fb62 100644
--- a/src/core/SkPixmap.cpp
+++ b/src/core/SkPixmap.cpp
@@ -272,13 +272,6 @@
         case kAlpha_8_SkColorType: {
             return SkColorSetA(0, *this->addr8(x, y));
         }
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType: {
-            SkASSERT(this->ctable());
-            SkPMColor c = (*this->ctable())[*this->addr8(x, y)];
-            return toColor(c);
-        }
-#endif
         case kRGB_565_SkColorType: {
             return SkPixel16ToColor(*this->addr16(x, y));
         }
@@ -334,20 +327,6 @@
             }
             return true;
         } break;
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType: {
-            const SkColorTable* ctable = this->ctable();
-            if (nullptr == ctable) {
-                return false;
-            }
-            const SkPMColor* table = ctable->readColors();
-            SkPMColor c = (SkPMColor)~0;
-            for (int i = ctable->count() - 1; i >= 0; --i) {
-                c &= table[i];
-            }
-            return 0xFF == SkGetPackedA32(c);
-        } break;
-#endif
         case kRGB_565_SkColorType:
         case kGray_8_SkColorType:
             return true;
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index b9c63ac..9bd3f2b 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -113,20 +113,6 @@
         pmap = tmpPixmap;
         // must rebuild desc, since we've forced the info to be N32
         *desc = GrImageInfoToSurfaceDesc(pmap->info(), caps);
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    } else if (kIndex_8_SkColorType == pixmap.colorType()) {
-        SkImageInfo info = SkImageInfo::MakeN32Premul(pixmap.width(), pixmap.height());
-        tmpBitmap->allocPixels(info);
-        if (!pixmap.readPixels(info, tmpBitmap->getPixels(), tmpBitmap->rowBytes())) {
-            return nullptr;
-        }
-        if (!tmpBitmap->peekPixels(tmpPixmap)) {
-            return nullptr;
-        }
-        pmap = tmpPixmap;
-        // must rebuild desc, since we've forced the info to be N32
-        *desc = GrImageInfoToSurfaceDesc(pmap->info(), caps);
-#endif
     }
 
     return pmap;
@@ -341,10 +327,6 @@
         case kBGRA_8888_SkColorType:
             return (caps.srgbSupport() && cs && cs->gammaCloseToSRGB())
                    ? kSBGRA_8888_GrPixelConfig : kBGRA_8888_GrPixelConfig;
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-            return kSkia8888_GrPixelConfig;
-#endif
         case kGray_8_SkColorType:
             return kGray_8_GrPixelConfig;
         case kRGBA_F16_SkColorType:
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp
index e760d03..1302552 100644
--- a/src/image/SkImage_Lazy.cpp
+++ b/src/image/SkImage_Lazy.cpp
@@ -206,14 +206,6 @@
         fInfo = fInfo.makeColorSpace(colorSpace);
         fUniqueID = SkNextID::ImageID();
     }
-
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    // colortables are poorly to not-at-all supported in our resourcecache, so we
-    // bully them into N32 (the generator will perform the up-sample)
-    if (fInfo.colorType() == kIndex_8_SkColorType) {
-        fInfo = fInfo.makeColorType(kN32_SkColorType);
-    }
-#endif
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -248,9 +240,6 @@
         , fInfo(validator->fInfo)
         , fOrigin(validator->fOrigin) {
     SkASSERT(fSharedGenerator);
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    SkASSERT(kIndex_8_SkColorType != fInfo.colorType());
-#endif
     // We explicit set the legacy format slot, but leave the others uninitialized (via SkOnce)
     // and only resolove them to IDs as needed (by calling getUniqueID()).
     fIDRecs[kLegacy_CachedFormat].fOnce([this, validator] {
@@ -317,12 +306,6 @@
             // TODO: Ask the codec to decode these to something else (at least sRGB 8888)?
             return kLegacy_CachedFormat;
 
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-            SkDEBUGFAIL("Index_8 should have been remapped at construction time.");
-            return kLegacy_CachedFormat;
-#endif
-
         case kGray_8_SkColorType:
             // TODO: What do we do with grayscale sources that have strange color spaces attached?
             // The codecs and color space xform don't handle this correctly (yet), so drop it on
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index eba6dc6..eef8161 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -57,11 +57,6 @@
         if (kUnknown_SkColorType == info.colorType()) {
             return false;
         }
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        if (kIndex_8_SkColorType == info.colorType()) {
-            return false;
-        }
-#endif
         if (rowBytes < info.minRowBytes()) {
             return false;
         }
diff --git a/src/images/SkJpegEncoder.cpp b/src/images/SkJpegEncoder.cpp
index ef78b21..2e79a9f 100644
--- a/src/images/SkJpegEncoder.cpp
+++ b/src/images/SkJpegEncoder.cpp
@@ -113,17 +113,6 @@
             jpegColorType = JCS_RGB;
             numComponents = 3;
             break;
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-            if (SkJpegEncoder::AlphaOption::kBlendOnBlack == options.fAlphaOption) {
-                return false;
-            }
-
-            fProc = transform_scanline_index8_opaque;
-            jpegColorType = JCS_RGB;
-            numComponents = 3;
-            break;
-#endif
         case kGray_8_SkColorType:
             SkASSERT(srcInfo.isOpaque());
             jpegColorType = JCS_GRAYSCALE;
diff --git a/src/images/SkPngEncoder.cpp b/src/images/SkPngEncoder.cpp
index 1e11269..0b9ef03 100644
--- a/src/images/SkPngEncoder.cpp
+++ b/src/images/SkPngEncoder.cpp
@@ -115,16 +115,6 @@
             pngColorType = srcInfo.isOpaque() ? PNG_COLOR_TYPE_RGB : PNG_COLOR_TYPE_RGB_ALPHA;
             fPngBytesPerPixel = 8;
             break;
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-            sigBit.red = 8;
-            sigBit.green = 8;
-            sigBit.blue = 8;
-            sigBit.alpha = 8;
-            pngColorType = PNG_COLOR_TYPE_PALETTE;
-            fPngBytesPerPixel = 1;
-            break;
-#endif
         case kGray_8_SkColorType:
             sigBit.gray = 8;
             pngColorType = PNG_COLOR_TYPE_GRAY;
@@ -252,9 +242,6 @@
                     SkASSERT(false);
                     return nullptr;
             }
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-#endif
         case kGray_8_SkColorType:
             return transform_scanline_memcpy;
         case kRGBA_F16_SkColorType:
@@ -274,91 +261,11 @@
     }
 }
 
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-/*
- * Pack palette[] with the corresponding colors, and if the image has alpha, also
- * pack trans[] and return the number of alphas[] entries written. If the image is
- * opaque, the return value will always be 0.
- */
-static inline int pack_palette(SkColorTable* ctable, png_color* SK_RESTRICT palette,
-                               png_byte* SK_RESTRICT alphas, const SkImageInfo& info,
-                               SkTransferFunctionBehavior unpremulBehavior) {
-    const SkPMColor* colors = ctable->readColors();
-    const int count = ctable->count();
-    SkPMColor storage[256];
-    if (kPremul_SkAlphaType == info.alphaType()) {
-        // Unpremultiply the colors.
-        const SkImageInfo rgbaInfo = info.makeColorType(kRGBA_8888_SkColorType);
-        transform_scanline_proc proc = choose_proc(rgbaInfo, unpremulBehavior);
-        proc((char*) storage, (const char*) colors, ctable->count(), 4, nullptr);
-        colors = storage;
-    }
-
-    int numWithAlpha = 0;
-    if (kOpaque_SkAlphaType != info.alphaType()) {
-        // PNG requires that all non-opaque colors come first in the palette.  Write these first.
-        for (int i = 0; i < count; i++) {
-            uint8_t alpha = SkGetPackedA32(colors[i]);
-            if (0xFF != alpha) {
-                alphas[numWithAlpha] = alpha;
-                palette[numWithAlpha].red   = SkGetPackedR32(colors[i]);
-                palette[numWithAlpha].green = SkGetPackedG32(colors[i]);
-                palette[numWithAlpha].blue  = SkGetPackedB32(colors[i]);
-                numWithAlpha++;
-            }
-        }
-    }
-
-    if (0 == numWithAlpha) {
-        // All of the entries are opaque.
-        for (int i = 0; i < count; i++) {
-            SkPMColor c = *colors++;
-            palette[i].red   = SkGetPackedR32(c);
-            palette[i].green = SkGetPackedG32(c);
-            palette[i].blue  = SkGetPackedB32(c);
-        }
-    } else {
-        // We have already written the non-opaque colors.  Now just write the opaque colors.
-        int currIndex = numWithAlpha;
-        int i = 0;
-        while (currIndex != count) {
-            uint8_t alpha = SkGetPackedA32(colors[i]);
-            if (0xFF == alpha) {
-                palette[currIndex].red   = SkGetPackedR32(colors[i]);
-                palette[currIndex].green = SkGetPackedG32(colors[i]);
-                palette[currIndex].blue  = SkGetPackedB32(colors[i]);
-                currIndex++;
-            }
-
-            i++;
-        }
-    }
-
-    return numWithAlpha;
-}
-#endif
-
 bool SkPngEncoderMgr::setPalette(const SkImageInfo& srcInfo, SkColorTable* colorTable,
                                  SkTransferFunctionBehavior unpremulBehavior) {
     if (setjmp(png_jmpbuf(fPngPtr))) {
         return false;
     }
-
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    png_color paletteColors[256];
-    png_byte trans[256];
-    if (kIndex_8_SkColorType == srcInfo.colorType()) {
-        if (!colorTable || colorTable->count() <= 0) {
-            return false;
-        }
-
-        int numTrans = pack_palette(colorTable, paletteColors, trans, srcInfo, unpremulBehavior);
-        png_set_PLTE(fPngPtr, fInfoPtr, paletteColors, colorTable->count());
-        if (numTrans > 0) {
-            png_set_tRNS(fPngPtr, fInfoPtr, trans, numTrans, nullptr);
-        }
-    }
-#endif
     return true;
 }
 
diff --git a/src/images/SkWebpEncoder.cpp b/src/images/SkWebpEncoder.cpp
index a5d0ffa..c43ab86 100644
--- a/src/images/SkWebpEncoder.cpp
+++ b/src/images/SkWebpEncoder.cpp
@@ -86,20 +86,6 @@
                 default:
                     return nullptr;
             }
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-            switch (info.alphaType()) {
-                case kOpaque_SkAlphaType:
-                    return transform_scanline_index8_opaque;
-                case kUnpremul_SkAlphaType:
-                case kPremul_SkAlphaType:
-                    // If the color table is premultiplied, we'll fix it before calling the
-                    // scanline proc.
-                    return transform_scanline_index8_unpremul;
-                default:
-                    return nullptr;
-            }
-#endif
         case kGray_8_SkColorType:
             return transform_scanline_gray;
         case kRGBA_F16_SkColorType:
@@ -149,23 +135,6 @@
     }
 
     const SkPMColor* colors = nullptr;
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    SkPMColor storage[256];
-    if (kIndex_8_SkColorType == pixmap.colorType()) {
-        if (!pixmap.ctable()) {
-            return false;
-        }
-
-        colors = pixmap.ctable()->readColors();
-        if (kPremul_SkAlphaType == pixmap.alphaType()) {
-            // Unpremultiply the colors.
-            const SkImageInfo rgbaInfo = pixmap.info().makeColorType(kRGBA_8888_SkColorType);
-            transform_scanline_proc proc = choose_proc(rgbaInfo, opts.fUnpremulBehavior);
-            proc((char*) storage, (const char*) colors, pixmap.ctable()->count(), 4, nullptr);
-            colors = storage;
-        }
-    }
-#endif
 
     WebPConfig webp_config;
     if (!WebPConfigPreset(&webp_config, WEBP_PRESET_DEFAULT, opts.fQuality)) {
diff --git a/src/pdf/SkPDFBitmap.cpp b/src/pdf/SkPDFBitmap.cpp
index 47facff..d0dcce6 100644
--- a/src/pdf/SkPDFBitmap.cpp
+++ b/src/pdf/SkPDFBitmap.cpp
@@ -20,18 +20,7 @@
     SkColorSpace* legacyColorSpace = nullptr;
     if(as_IB(image)->getROPixels(dst, legacyColorSpace)
        && dst->dimensions() == image->dimensions()) {
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        if (dst->colorType() != kIndex_8_SkColorType) {
-            return;
-        }
-        if (!dst->getColorTable()) {
-            // We can't use an indexed bitmap with no colortable.
-            dst->reset();
-        } else
-#endif
-        {
-            return;
-        }
+        return;
     }
     // no pixels or wrong size: fill with zeros.
     dst->setInfo(SkImageInfo::MakeN32(image->width(), image->height(), image->alphaType()));
@@ -166,9 +155,6 @@
         case kBGRA_8888_SkColorType:
             return 3;
         case kAlpha_8_SkColorType:
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-#endif
         case kGray_8_SkColorType:
             return 1;
         case kUnknown_SkColorType:
@@ -239,9 +225,6 @@
             fill_stream(out, '\x00', pixel_count(bm));
             return;
         case kGray_8_SkColorType:
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType:
-#endif
             SkASSERT(1 == pdf_color_component_count(colorType));
             // these two formats need no transformation to serialize.
             for (int y = 0; y < bm.height(); ++y) {
@@ -284,22 +267,6 @@
                 out->write(bm.getAddr8(0, y), bm.width());
             }
             return;
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        case kIndex_8_SkColorType: {
-            SkColorTable* ct = bm.getColorTable();
-            SkASSERT(ct);
-            SkAutoTMalloc<uint8_t> scanline(bm.width());
-            for (int y = 0; y < bm.height(); ++y) {
-                uint8_t* dst = scanline.get();
-                const uint8_t* src = bm.getAddr8(0, y);
-                for (int x = 0; x < bm.width(); ++x) {
-                    *dst++ = SkGetPackedA32((*ct)[*src++]);
-                }
-                out->write(scanline.get(), bm.width());
-            }
-            return;
-        }
-#endif
         case kRGB_565_SkColorType:
         case kGray_8_SkColorType:
             SkDEBUGFAIL("color type has no alpha");
@@ -313,46 +280,6 @@
     }
 }
 
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-static sk_sp<SkPDFArray> make_indexed_color_space(
-        const SkColorTable* table,
-        SkAlphaType alphaType) {
-    auto result = sk_make_sp<SkPDFArray>();
-    result->reserve(4);
-    result->appendName("Indexed");
-    result->appendName("DeviceRGB");
-    SkASSERT(table);
-    if (table->count() < 1) {
-        result->appendInt(0);
-        char shortTableArray[3] = {0, 0, 0};
-        SkString tableString(shortTableArray, SK_ARRAY_COUNT(shortTableArray));
-        result->appendString(tableString);
-        return result;
-    }
-    result->appendInt(table->count() - 1);  // maximum color index.
-
-    // Potentially, this could be represented in fewer bytes with a stream.
-    // Max size as a string is 1.5k.
-    char tableArray[256 * 3];
-    SkASSERT(3u * table->count() <= SK_ARRAY_COUNT(tableArray));
-    uint8_t* tablePtr = reinterpret_cast<uint8_t*>(tableArray);
-    const SkPMColor* colors = table->readColors();
-    for (int i = 0; i < table->count(); i++) {
-        if (alphaType == kPremul_SkAlphaType) {
-            pmcolor_to_rgb24(colors[i], tablePtr, kN32_SkColorType);
-            tablePtr += 3;
-        } else {
-            *tablePtr++ = SkGetR32Component(colors[i], kN32_SkColorType);
-            *tablePtr++ = SkGetG32Component(colors[i], kN32_SkColorType);
-            *tablePtr++ = SkGetB32Component(colors[i], kN32_SkColorType);
-        }
-    }
-    SkString tableString(tableArray, 3 * table->count());
-    result->appendString(tableString);
-    return result;
-}
-#endif
-
 static void emit_image_xobject(SkWStream* stream,
                                const SkImage* image,
                                bool alpha,
@@ -377,13 +304,6 @@
     pdfDict.insertInt("Height", bitmap.height());
     if (alpha) {
         pdfDict.insertName("ColorSpace", "DeviceGray");
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    } else if (bitmap.colorType() == kIndex_8_SkColorType) {
-        SkASSERT(1 == pdf_color_component_count(bitmap.colorType()));
-        pdfDict.insertObject("ColorSpace",
-                             make_indexed_color_space(bitmap.getColorTable(),
-                                                      bitmap.alphaType()));
-#endif
     } else if (1 == pdf_color_component_count(bitmap.colorType())) {
         pdfDict.insertName("ColorSpace", "DeviceGray");
     } else {
diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp
index 1fc9145..02cc2fd 100644
--- a/src/shaders/SkImageShader.cpp
+++ b/src/shaders/SkImageShader.cpp
@@ -326,9 +326,6 @@
         }
         switch (info.colorType()) {
             case kAlpha_8_SkColorType:   p->append(SkRasterPipeline::gather_a8,   gather); break;
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-            case kIndex_8_SkColorType:   p->append(SkRasterPipeline::gather_i8,   gather); break;
-#endif
             case kGray_8_SkColorType:    p->append(SkRasterPipeline::gather_g8,   gather); break;
             case kRGB_565_SkColorType:   p->append(SkRasterPipeline::gather_565,  gather); break;
             case kARGB_4444_SkColorType: p->append(SkRasterPipeline::gather_4444, gather); break;
@@ -392,11 +389,6 @@
         p->append(SkRasterPipeline::move_dst_src);
     }
 
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-    if (info.colorType() == kIndex_8_SkColorType && kN32_SkColorType == kBGRA_8888_SkColorType) {
-        p->append(SkRasterPipeline::swap_rb);
-    }
-#endif
     if (info.colorType() == kAlpha_8_SkColorType) {
         p->append(SkRasterPipeline::set_rgb, &misc->paint_color);
     }
diff --git a/tests/ImageIsOpaqueTest.cpp b/tests/ImageIsOpaqueTest.cpp
index df1d56c..bf3dea6 100644
--- a/tests/ImageIsOpaqueTest.cpp
+++ b/tests/ImageIsOpaqueTest.cpp
@@ -61,11 +61,6 @@
     };
 
     for (int ct = 0; ct <= kLastEnum_SkColorType; ++ct) {
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        if (ct == kIndex_8_SkColorType) {
-            continue;
-        }
-#endif
         for (int at = 0; at <= kLastEnum_SkAlphaType; ++at) {
             for (auto& cs : spaces) {
                 SkImageInfo info = SkImageInfo::Make(100, 200,
diff --git a/tools/debugger/SkObjectParser.cpp b/tools/debugger/SkObjectParser.cpp
index 57f7d91..1f48319 100644
--- a/tools/debugger/SkObjectParser.cpp
+++ b/tools/debugger/SkObjectParser.cpp
@@ -29,9 +29,6 @@
 
     const char* gColorTypeStrings[] = {
         "None", "A8", "565", "4444", "RGBA", "BGRA",
-#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE
-        "Index8",
-#endif
         "G8", "RGBAf16"
     };
     static_assert(kLastEnum_SkColorType + 1 == SK_ARRAY_COUNT(gColorTypeStrings),