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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
617 return SkImageGenerator::kSuccess; | 617 return SkImageGenerator::kSuccess; |
618 } | 618 } |
619 | 619 |
620 SkImageGenerator::Result onSkipScanlines(int count) override { | 620 SkImageGenerator::Result onSkipScanlines(int count) override { |
621 // FIXME: Could we use the return value of setjmp to specify the type of | 621 // FIXME: Could we use the return value of setjmp to specify the type of |
622 // error? | 622 // error? |
623 if (setjmp(png_jmpbuf(fCodec->fPng_ptr))) { | 623 if (setjmp(png_jmpbuf(fCodec->fPng_ptr))) { |
624 SkCodecPrintf("setjmp long jump!\n"); | 624 SkCodecPrintf("setjmp long jump!\n"); |
625 return SkImageGenerator::kInvalidInput; | 625 return SkImageGenerator::kInvalidInput; |
626 } | 626 } |
627 | 627 for (int i = 0; i < count; i++) { |
scroggo
2015/05/21 19:32:36
This should perhaps be a separate CL, since it fix
| |
628 png_read_rows(fCodec->fPng_ptr, png_bytepp_NULL, png_bytepp_NULL, count) ; | 628 png_read_rows(fCodec->fPng_ptr, &fSrcRow, png_bytepp_NULL, 1); |
scroggo
2015/05/21 19:32:36
Maybe add a comment here that explains the potenti
emmaleeroach
2015/05/21 22:17:24
On 2015/05/21 19:32:36, scroggo wrote:
> Maybe add
| |
629 } | |
629 return SkImageGenerator::kSuccess; | 630 return SkImageGenerator::kSuccess; |
630 } | 631 } |
631 | 632 |
632 void onFinish() override { | 633 void onFinish() override { |
633 fCodec->finish(); | 634 fCodec->finish(); |
634 } | 635 } |
635 | 636 |
636 bool onReallyHasAlpha() const override { return fHasAlpha; } | 637 bool onReallyHasAlpha() const override { return fHasAlpha; } |
637 | 638 |
638 private: | 639 private: |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
671 | 672 |
672 SkASSERT(fNumberPasses != INVALID_NUMBER_PASSES); | 673 SkASSERT(fNumberPasses != INVALID_NUMBER_PASSES); |
673 if (fNumberPasses > 1) { | 674 if (fNumberPasses > 1) { |
674 // We cannot efficiently do scanline decoding. | 675 // We cannot efficiently do scanline decoding. |
675 return NULL; | 676 return NULL; |
676 } | 677 } |
677 | 678 |
678 return SkNEW_ARGS(SkPngScanlineDecoder, (dstInfo, this)); | 679 return SkNEW_ARGS(SkPngScanlineDecoder, (dstInfo, this)); |
679 } | 680 } |
680 | 681 |
OLD | NEW |