aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/android')
-rw-r--r--src/android/SkBitmapRegionCodec.cpp17
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 = &subset;
- 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;
}