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

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

Issue 1372973002: Move all knowledge of X sampling into SkScaledCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@codecSDmerge
Patch Set: Attempt to fix RLE overflow Created 5 years, 2 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_libico.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 23 matching lines...) Expand all
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 final; 39 bool onReallyHasAlpha() const final;
40 40
41 // Helper to set up swizzler and color table. Also calls png_read_update_inf o. 41 // Helper to set up swizzler and color table. Also calls png_read_update_inf o.
42 Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&, 42 Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&,
43 SkPMColor*, int* ctableCount); 43 SkPMColor*, int* ctableCount);
44 SkSampler* getSampler() override { return fSwizzler; }
44 45
45 SkPngCodec(const SkImageInfo&, SkStream*, png_structp, png_infop, int, int); 46 SkPngCodec(const SkImageInfo&, SkStream*, png_structp, png_infop, int, int);
46 47
47 png_structp png_ptr() { return fPng_ptr; } 48 png_structp png_ptr() { return fPng_ptr; }
48 SkSwizzler* swizzler() { return fSwizzler; } 49 SkSwizzler* swizzler() { return fSwizzler; }
49 SkSwizzler::SrcConfig srcConfig() const { return fSrcConfig; } 50 SkSwizzler::SrcConfig srcConfig() const { return fSrcConfig; }
50 int numberPasses() const { return fNumberPasses; } 51 int numberPasses() const { return fNumberPasses; }
51 52
52 enum AlphaState { 53 enum AlphaState {
53 // This class has done no decoding, or threw away its knowledge (in 54 // This class has done no decoding, or threw away its knowledge (in
(...skipping 20 matching lines...) Expand all
74 const int fNumberPasses; 75 const int fNumberPasses;
75 int fBitDepth; 76 int fBitDepth;
76 77
77 AlphaState fAlphaState; 78 AlphaState fAlphaState;
78 79
79 bool decodePalette(bool premultiply, int* ctableCount); 80 bool decodePalette(bool premultiply, int* ctableCount);
80 void destroyReadStruct(); 81 void destroyReadStruct();
81 82
82 typedef SkCodec INHERITED; 83 typedef SkCodec INHERITED;
83 }; 84 };
OLDNEW
« no previous file with comments | « src/codec/SkCodec_libico.cpp ('k') | src/codec/SkCodec_libpng.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698