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/codec/SkPngCodec.cpp | |
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/codec/SkPngCodec.cpp')
-rw-r--r-- | src/codec/SkPngCodec.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/codec/SkPngCodec.cpp b/src/codec/SkPngCodec.cpp index d77fe4007d..ea832ff688 100644 --- a/src/codec/SkPngCodec.cpp +++ b/src/codec/SkPngCodec.cpp @@ -245,7 +245,7 @@ void SkPngCodec::processData() { static const SkColorType kXformSrcColorType = kRGBA_8888_SkColorType; // Note: SkColorTable claims to store SkPMColors, which is not necessarily the case here. -bool SkPngCodec::createColorTable(const SkImageInfo& dstInfo, int* ctableCount) { +bool SkPngCodec::createColorTable(const SkImageInfo& dstInfo) { int numColors; png_color* palette; @@ -308,11 +308,6 @@ bool SkPngCodec::createColorTable(const SkImageInfo& dstInfo, int* ctableCount) sk_memset32(colorTable + numColors, lastColor, maxColors - numColors); } - // Set the new color count. - if (ctableCount != nullptr) { - *ctableCount = maxColors; - } - fColorTable.reset(new SkColorTable(colorTable, maxColors)); return true; } @@ -973,8 +968,7 @@ void SkPngCodec::destroyReadStruct() { // Getting the pixels /////////////////////////////////////////////////////////////////////////////// -SkCodec::Result SkPngCodec::initializeXforms(const SkImageInfo& dstInfo, const Options& options, - SkPMColor ctable[], int* ctableCount) { +SkCodec::Result SkPngCodec::initializeXforms(const SkImageInfo& dstInfo, const Options& options) { if (setjmp(PNG_JMPBUF((png_struct*)fPng_ptr))) { SkCodecPrintf("Failed on png_read_update_info.\n"); return kInvalidInput; @@ -1011,14 +1005,11 @@ SkCodec::Result SkPngCodec::initializeXforms(const SkImageInfo& dstInfo, const O } if (SkEncodedInfo::kPalette_Color == this->getEncodedInfo().color()) { - if (!this->createColorTable(dstInfo, ctableCount)) { + if (!this->createColorTable(dstInfo)) { return kInvalidInput; } } - // Copy the color table to the client if they request kIndex8 mode. - copy_color_table(dstInfo, fColorTable.get(), ctable, ctableCount); - this->initializeSwizzler(dstInfo, options, skipFormatConversion); return kSuccess; } @@ -1092,13 +1083,12 @@ bool SkPngCodec::onRewind() { SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t rowBytes, const Options& options, - SkPMColor ctable[], int* ctableCount, int* rowsDecoded) { if (!conversion_possible(dstInfo, this->getInfo())) { return kInvalidConversion; } - Result result = this->initializeXforms(dstInfo, options, ctable, ctableCount); + Result result = this->initializeXforms(dstInfo, options); if (kSuccess != result) { return result; } @@ -1113,13 +1103,12 @@ SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& dstInfo, void* dst, } SkCodec::Result SkPngCodec::onStartIncrementalDecode(const SkImageInfo& dstInfo, - void* dst, size_t rowBytes, const SkCodec::Options& options, - SkPMColor* ctable, int* ctableCount) { + void* dst, size_t rowBytes, const SkCodec::Options& options) { if (!conversion_possible(dstInfo, this->getInfo())) { return kInvalidConversion; } - Result result = this->initializeXforms(dstInfo, options, ctable, ctableCount); + Result result = this->initializeXforms(dstInfo, options); if (kSuccess != result) { return result; } |