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

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

Issue 1260673002: SkScaledCodec class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Stop DM from running large interlaced images on 32-bit Ubuntu GCE bots b/c they are running out of … 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
« no previous file with comments | « src/codec/SkCodec_libgif.cpp ('k') | src/codec/SkCodec_libpng.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.h" 8 #include "SkCodec.h"
9 #include "SkColorTable.h" 9 #include "SkColorTable.h"
10 #include "SkEncodedFormat.h" 10 #include "SkEncodedFormat.h"
(...skipping 19 matching lines...) Expand all
30 static SkScanlineDecoder* NewSDFromStream(SkStream*); 30 static SkScanlineDecoder* NewSDFromStream(SkStream*);
31 31
32 virtual ~SkPngCodec(); 32 virtual ~SkPngCodec();
33 33
34 protected: 34 protected:
35 Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMCo lor*, int*) 35 Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMCo lor*, int*)
36 override; 36 override;
37 SkEncodedFormat onGetEncodedFormat() const override { return kPNG_SkEncodedF ormat; } 37 SkEncodedFormat onGetEncodedFormat() const override { return kPNG_SkEncodedF ormat; }
38 bool onRewind() override; 38 bool onRewind() override;
39 bool onReallyHasAlpha() const override { return fReallyHasAlpha; } 39 bool onReallyHasAlpha() const override { return fReallyHasAlpha; }
40
40 private: 41 private:
41 png_structp fPng_ptr; 42 png_structp fPng_ptr;
42 png_infop fInfo_ptr; 43 png_infop fInfo_ptr;
43 44
44 // These are stored here so they can be used both by normal decoding and sca nline decoding. 45 // These are stored here so they can be used both by normal decoding and sca nline decoding.
45 SkAutoTUnref<SkColorTable> fColorTable; // May be unpremul. 46 SkAutoTUnref<SkColorTable> fColorTable; // May be unpremul.
46 SkAutoTDelete<SkSwizzler> fSwizzler; 47 SkAutoTDelete<SkSwizzler> fSwizzler;
47 48
48 SkSwizzler::SrcConfig fSrcConfig; 49 SkSwizzler::SrcConfig fSrcConfig;
49 int fNumberPasses; 50 int fNumberPasses;
50 bool fReallyHasAlpha; 51 bool fReallyHasAlpha;
51 int fBitDepth; 52 int fBitDepth;
52 53
53 SkPngCodec(const SkImageInfo&, SkStream*, png_structp, png_infop, int); 54 SkPngCodec(const SkImageInfo&, SkStream*, png_structp, png_infop, int);
54 55
55
56 // Helper to set up swizzler and color table. Also calls png_read_update_inf o. 56 // Helper to set up swizzler and color table. Also calls png_read_update_inf o.
57 Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&, 57 Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&,
58 SkPMColor*, int* ctableCount); 58 SkPMColor*, int* ctableCount);
59 59
60 bool decodePalette(bool premultiply, int* ctableCount); 60 bool decodePalette(bool premultiply, int* ctableCount);
61 void destroyReadStruct(); 61 void destroyReadStruct();
62 62
63 friend class SkPngScanlineDecoder; 63 friend class SkPngScanlineDecoder;
64 friend class SkPngInterlacedScanlineDecoder; 64 friend class SkPngInterlacedScanlineDecoder;
65 65
66 typedef SkCodec INHERITED; 66 typedef SkCodec INHERITED;
67 }; 67 };
OLDNEW
« no previous file with comments | « src/codec/SkCodec_libgif.cpp ('k') | src/codec/SkCodec_libpng.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698