OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkCodec_libpng.h" | 8 #include "SkCodec_libpng.h" |
9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 return false; | 510 return false; |
511 } | 511 } |
512 } | 512 } |
513 | 513 |
514 SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void*
dst, | 514 SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void*
dst, |
515 size_t rowBytes, const Options& options, | 515 size_t rowBytes, const Options& options, |
516 SkPMColor ctable[], int* ctableCount) { | 516 SkPMColor ctable[], int* ctableCount) { |
517 if (!conversion_possible(requestedInfo, this->getInfo())) { | 517 if (!conversion_possible(requestedInfo, this->getInfo())) { |
518 return kInvalidConversion; | 518 return kInvalidConversion; |
519 } | 519 } |
| 520 if (options.fSubset) { |
| 521 // Subsets are not supported. |
| 522 return kUnimplemented; |
| 523 } |
520 if (requestedInfo.dimensions() != this->getInfo().dimensions()) { | 524 if (requestedInfo.dimensions() != this->getInfo().dimensions()) { |
521 return kInvalidScale; | 525 return kInvalidScale; |
522 } | 526 } |
523 if (!this->handleRewind()) { | 527 if (!this->handleRewind()) { |
524 return kCouldNotRewind; | 528 return kCouldNotRewind; |
525 } | 529 } |
526 | 530 |
527 // Note that ctable and ctableCount may be modified if there is a color tabl
e | 531 // Note that ctable and ctableCount may be modified if there is a color tabl
e |
528 const Result result = this->initializeSwizzler(requestedInfo, dst, rowBytes, | 532 const Result result = this->initializeSwizzler(requestedInfo, dst, rowBytes, |
529 options, ctable, ctableCount)
; | 533 options, ctable, ctableCount)
; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 | 764 |
761 SkASSERT(codec->fNumberPasses != INVALID_NUMBER_PASSES); | 765 SkASSERT(codec->fNumberPasses != INVALID_NUMBER_PASSES); |
762 if (codec->fNumberPasses > 1) { | 766 if (codec->fNumberPasses > 1) { |
763 // interlaced image | 767 // interlaced image |
764 return SkNEW_ARGS(SkPngInterlacedScanlineDecoder, (dstInfo, codec.detach
())); | 768 return SkNEW_ARGS(SkPngInterlacedScanlineDecoder, (dstInfo, codec.detach
())); |
765 } | 769 } |
766 | 770 |
767 return SkNEW_ARGS(SkPngScanlineDecoder, (dstInfo, codec.detach())); | 771 return SkNEW_ARGS(SkPngScanlineDecoder, (dstInfo, codec.detach())); |
768 } | 772 } |
769 | 773 |
OLD | NEW |