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

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

Issue 1820073002: Add SkEncodedInfo to report properties of encoded image data (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Order of param eval bug Created 4 years, 8 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/SkJpegDecoderMgr.cpp ('k') | src/codec/SkPngCodec.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 "SkPngChunkReader.h" 10 #include "SkPngChunkReader.h"
(...skipping 23 matching lines...) Expand all
34 uint32_t onGetFillValue(SkColorType) const override; 34 uint32_t onGetFillValue(SkColorType) const override;
35 35
36 // Helper to set up swizzler and color table. Also calls png_read_update_inf o. 36 // Helper to set up swizzler and color table. Also calls png_read_update_inf o.
37 Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&, 37 Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&,
38 SkPMColor*, int* ctableCount); 38 SkPMColor*, int* ctableCount);
39 SkSampler* getSampler(bool createIfNecessary) override { 39 SkSampler* getSampler(bool createIfNecessary) override {
40 SkASSERT(fSwizzler); 40 SkASSERT(fSwizzler);
41 return fSwizzler; 41 return fSwizzler;
42 } 42 }
43 43
44 SkPngCodec(const SkImageInfo&, SkStream*, SkPngChunkReader*, png_structp, pn g_infop, int, int, 44 SkPngCodec(int width, int height, const SkEncodedInfo&, SkStream*, SkPngChun kReader*,
45 sk_sp<SkColorSpace>); 45 png_structp, png_infop, int, int, sk_sp<SkColorSpace>);
46 46
47 png_structp png_ptr() { return fPng_ptr; } 47 png_structp png_ptr() { return fPng_ptr; }
48 SkSwizzler* swizzler() { return fSwizzler; } 48 SkSwizzler* swizzler() { return fSwizzler; }
49 SkSwizzler::SrcConfig srcConfig() const { return fSrcConfig; } 49 SkSwizzler::SrcConfig srcConfig() const { return fSrcConfig; }
50 int numberPasses() const { return fNumberPasses; } 50 int numberPasses() const { return fNumberPasses; }
51 51
52 private: 52 private:
53 SkAutoTUnref<SkPngChunkReader> fPngChunkReader; 53 SkAutoTUnref<SkPngChunkReader> fPngChunkReader;
54 png_structp fPng_ptr; 54 png_structp fPng_ptr;
55 png_infop fInfo_ptr; 55 png_infop fInfo_ptr;
56 56
57 // These are stored here so they can be used both by normal decoding and sca nline decoding. 57 // These are stored here so they can be used both by normal decoding and sca nline decoding.
58 SkAutoTUnref<SkColorTable> fColorTable; // May be unpremul. 58 SkAutoTUnref<SkColorTable> fColorTable; // May be unpremul.
59 SkAutoTDelete<SkSwizzler> fSwizzler; 59 SkAutoTDelete<SkSwizzler> fSwizzler;
60 60
61 SkSwizzler::SrcConfig fSrcConfig; 61 SkSwizzler::SrcConfig fSrcConfig;
62 const int fNumberPasses; 62 const int fNumberPasses;
63 int fBitDepth; 63 int fBitDepth;
64 64
65 bool decodePalette(bool premultiply, int* ctableCount); 65 bool decodePalette(bool premultiply, int* ctableCount);
66 void destroyReadStruct(); 66 void destroyReadStruct();
67 67
68 typedef SkCodec INHERITED; 68 typedef SkCodec INHERITED;
69 }; 69 };
OLDNEW
« no previous file with comments | « src/codec/SkJpegDecoderMgr.cpp ('k') | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698