Requires a minor API change to pass the color table to getScanlineDecoder, as we do with getPixels().
BUG=skia:3722
Review URL: https://codereview.chromium.org/1061713007
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp
index c4e4885..85f2414 100644
--- a/src/codec/SkCodec.cpp
+++ b/src/codec/SkCodec.cpp
@@ -90,7 +90,23 @@
: kCouldNotRewind_RewindState;
}
-SkScanlineDecoder* SkCodec::getScanlineDecoder(const SkImageInfo& dstInfo) {
- fScanlineDecoder.reset(this->onGetScanlineDecoder(dstInfo));
+SkScanlineDecoder* SkCodec::getScanlineDecoder(const SkImageInfo& dstInfo, const Options* options,
+ SkPMColor ctable[], int* ctableCount) {
+
+ // Set options.
+ Options optsStorage;
+ if (NULL == options) {
+ options = &optsStorage;
+ }
+
+ fScanlineDecoder.reset(this->onGetScanlineDecoder(dstInfo, *options, ctable, ctableCount));
return fScanlineDecoder.get();
}
+
+SkScanlineDecoder* SkCodec::getScanlineDecoder(const SkImageInfo& dstInfo) {
+ SkASSERT(kIndex_8_SkColorType != dstInfo.colorType());
+ if (kIndex_8_SkColorType == dstInfo.colorType()) {
+ return NULL;
+ }
+ return this->getScanlineDecoder(dstInfo, NULL, NULL, NULL);
+}