| 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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 } | 732 } |
| 733 | 733 |
| 734 SkCodec::Result onSkipScanlines(int count) override { | 734 SkCodec::Result onSkipScanlines(int count) override { |
| 735 //when ongetScanlines is called it will skip to fCurrentRow | 735 //when ongetScanlines is called it will skip to fCurrentRow |
| 736 fCurrentRow += count; | 736 fCurrentRow += count; |
| 737 return SkCodec::kSuccess; | 737 return SkCodec::kSuccess; |
| 738 } | 738 } |
| 739 | 739 |
| 740 bool onReallyHasAlpha() const override { return fHasAlpha; } | 740 bool onReallyHasAlpha() const override { return fHasAlpha; } |
| 741 | 741 |
| 742 bool onRequiresPostYSampling() override { | 742 SkScanlineOrder onGetScanlineOrder() const override { |
| 743 return true; | 743 return kNone_SkScanlineOrder; |
| 744 } | 744 } |
| 745 | 745 |
| 746 SkEncodedFormat onGetEncodedFormat() const override { | 746 SkEncodedFormat onGetEncodedFormat() const override { |
| 747 return kPNG_SkEncodedFormat; | 747 return kPNG_SkEncodedFormat; |
| 748 } | 748 } |
| 749 | 749 |
| 750 private: | 750 private: |
| 751 SkAutoTDelete<SkPngCodec> fCodec; | 751 SkAutoTDelete<SkPngCodec> fCodec; |
| 752 bool fHasAlpha; | 752 bool fHasAlpha; |
| 753 int fCurrentRow; | 753 int fCurrentRow; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 779 | 779 |
| 780 const SkImageInfo& srcInfo = codec->getInfo(); | 780 const SkImageInfo& srcInfo = codec->getInfo(); |
| 781 if (codec->fNumberPasses > 1) { | 781 if (codec->fNumberPasses > 1) { |
| 782 // interlaced image | 782 // interlaced image |
| 783 return new SkPngInterlacedScanlineDecoder(srcInfo, codec.detach()); | 783 return new SkPngInterlacedScanlineDecoder(srcInfo, codec.detach()); |
| 784 } | 784 } |
| 785 | 785 |
| 786 return new SkPngScanlineDecoder(srcInfo, codec.detach()); | 786 return new SkPngScanlineDecoder(srcInfo, codec.detach()); |
| 787 } | 787 } |
| 788 | 788 |
| OLD | NEW |