| Index: src/codec/SkCodec_libpng.cpp
|
| diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp
|
| index 0db425c3544d73e9fa986643ac09c9f90e7d9c47..4bde36a43191f0300e03c22fb5a7cb515ab97fd6 100644
|
| --- a/src/codec/SkCodec_libpng.cpp
|
| +++ b/src/codec/SkCodec_libpng.cpp
|
| @@ -394,7 +394,9 @@ void SkPngCodec::destroyReadStruct() {
|
| SkCodec::Result SkPngCodec::initializeSwizzler(const SkImageInfo& requestedInfo,
|
| const Options& options,
|
| SkPMColor ctable[],
|
| - int* ctableCount) {
|
| + int* ctableCount,
|
| + int subsetLeft,
|
| + int subsetWidth) {
|
| // FIXME: Could we use the return value of setjmp to specify the type of
|
| // error?
|
| if (setjmp(png_jmpbuf(fPng_ptr))) {
|
| @@ -436,7 +438,7 @@ SkCodec::Result SkPngCodec::initializeSwizzler(const SkImageInfo& requestedInfo,
|
| // Create the swizzler. SkPngCodec retains ownership of the color table.
|
| const SkPMColor* colors = get_color_ptr(fColorTable.get());
|
| fSwizzler.reset(SkSwizzler::CreateSwizzler(fSrcConfig, colors, requestedInfo,
|
| - options.fZeroInitialized));
|
| + options.fZeroInitialized, subsetLeft, subsetWidth));
|
| if (!fSwizzler) {
|
| // FIXME: CreateSwizzler could fail for another reason.
|
| return kUnimplemented;
|
| @@ -477,8 +479,8 @@ SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void*
|
| }
|
|
|
| // Note that ctable and ctableCount may be modified if there is a color table
|
| - const Result result = this->initializeSwizzler(requestedInfo, options,
|
| - ctable, ctableCount);
|
| + const Result result = this->initializeSwizzler(requestedInfo, options, ctable, ctableCount, 0,
|
| + requestedInfo.width());
|
| if (result != kSuccess) {
|
| return result;
|
| }
|
| @@ -611,13 +613,13 @@ public:
|
| {}
|
|
|
| Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& options,
|
| - SkPMColor ctable[], int* ctableCount) override {
|
| + SkPMColor ctable[], int* ctableCount, int subsetLeft, int subsetWidth) override {
|
| if (!conversion_possible(dstInfo, this->getInfo())) {
|
| return kInvalidConversion;
|
| }
|
|
|
| const Result result = this->initializeSwizzler(dstInfo, options, ctable,
|
| - ctableCount);
|
| + ctableCount, subsetLeft, subsetWidth);
|
| if (result != kSuccess) {
|
| return result;
|
| }
|
| @@ -698,15 +700,14 @@ public:
|
| }
|
|
|
| Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& options,
|
| - SkPMColor ctable[], int* ctableCount) override
|
| - {
|
| + SkPMColor ctable[], int* ctableCount, int subsetLeft, int subsetWidth) override {
|
| if (!conversion_possible(dstInfo, this->getInfo())) {
|
| return kInvalidConversion;
|
| }
|
|
|
| - const SkCodec::Result result = this->initializeSwizzler(dstInfo, options, ctable,
|
| - ctableCount);
|
| - if (result != SkCodec::kSuccess) {
|
| + const Result result = this->initializeSwizzler(dstInfo, options, ctable,
|
| + ctableCount, subsetLeft, subsetWidth);
|
| + if (result != kSuccess) {
|
| return result;
|
| }
|
|
|
|
|