diff options
author | Leon Scroggins III <scroggo@google.com> | 2017-07-10 11:51:37 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-10 17:06:48 +0000 |
commit | 742a3e298fda669006147e4a305bab8452369b1f (patch) | |
tree | 6b5ceb03ecdfbc3f3e86f16357207a67e82acb99 /src/android | |
parent | da1893fe3a654b551516ce706a363eebf8471511 (diff) |
Remove support for decoding to kIndex_8
Fix up callsites, and remove tests that no longer make sense.
Bug: skia:6828
Change-Id: I2548c4b7528b7b1be7412563156f27b52c9d4295
Reviewed-on: https://skia-review.googlesource.com/21664
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'src/android')
-rw-r--r-- | src/android/SkBitmapRegionCodec.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/android/SkBitmapRegionCodec.cpp b/src/android/SkBitmapRegionCodec.cpp index 7ce9d26b4d..c4e1ea124c 100644 --- a/src/android/SkBitmapRegionCodec.cpp +++ b/src/android/SkBitmapRegionCodec.cpp @@ -57,13 +57,7 @@ bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocat SkImageInfo decodeInfo = SkImageInfo::Make(scaledSize.width(), scaledSize.height(), dstColorType, dstAlphaType, dstColorSpace); - // Construct a color table for the decode if necessary - sk_sp<SkColorTable> colorTable(nullptr); - int maxColors = 256; - SkPMColor colors[256]; - if (kIndex_8_SkColorType == dstColorType) { - colorTable.reset(new SkColorTable(colors, maxColors)); - } + SkASSERT(dstColorType != kIndex_8_SkColorType); // Initialize the destination bitmap int scaledOutX = 0; @@ -90,7 +84,7 @@ bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocat outInfo = outInfo.makeColorType(kAlpha_8_SkColorType).makeAlphaType(kPremul_SkAlphaType); } bitmap->setInfo(outInfo); - if (!bitmap->tryAllocPixels(allocator, colorTable.get())) { + if (!bitmap->tryAllocPixels(allocator, nullptr)) { SkCodecPrintf("Error: Could not allocate pixels.\n"); return false; } @@ -112,8 +106,6 @@ bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocat SkAndroidCodec::AndroidOptions options; options.fSampleSize = sampleSize; options.fSubset = ⊂ - options.fColorPtr = colors; - options.fColorCount = &maxColors; options.fZeroInitialized = zeroInit; void* dst = bitmap->getAddr(scaledOutX, scaledOutY); @@ -124,11 +116,6 @@ bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocat return false; } - // Intialize the color table - if (kIndex_8_SkColorType == dstColorType) { - colorTable->dangerous_overwriteColors(colors, maxColors); - } - return true; } |