Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: src/codec/SkCodec_libpng.cpp

Issue 1287423002: Scanline decoding for bmp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add SkScanlineOrder enum to SkScanlineDecoder.h Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698