diff options
Diffstat (limited to 'gm/encode-srgb.cpp')
-rw-r--r-- | gm/encode-srgb.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gm/encode-srgb.cpp b/gm/encode-srgb.cpp index 894b0ef8d5..f62d48ae2c 100644 --- a/gm/encode-srgb.cpp +++ b/gm/encode-srgb.cpp @@ -67,9 +67,10 @@ static void make_index8(SkBitmap* bitmap, SkAlphaType alphaType, sk_sp<SkColorSp pmColors[i] = toPMColor(colors[i]); } + sk_sp<SkColorTable> colorTable(new SkColorTable(pmColors, SK_ARRAY_COUNT(pmColors))); SkImageInfo info = SkImageInfo::Make(imageWidth, imageHeight, kIndex_8_SkColorType, alphaType, colorSpace); - bitmap->allocPixels(info, SkColorTable::Make(pmColors, SK_ARRAY_COUNT(pmColors))); + bitmap->allocPixels(info, nullptr, colorTable.get()); for (int y = 0; y < imageHeight; y++) { for (int x = 0; x < imageWidth; x++) { *bitmap->getAddr8(x, y) = (x / div_round_up(imageWidth, 2)) + |