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