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

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

Issue 2212563003: Modify SkPngCodec to recognize 565 images from the sBIT chunk (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Allow SkPngCodec to set SkImageInfo directly Created 4 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.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 "SkColorSpaceXform.h" 9 #include "SkColorSpaceXform.h"
10 #include "SkColorTable.h" 10 #include "SkColorTable.h"
(...skipping 28 matching lines...) Expand all
39 int* colorCount); 39 int* colorCount);
40 SkSampler* getSampler(bool createIfNecessary) override { 40 SkSampler* getSampler(bool createIfNecessary) override {
41 SkASSERT(fSwizzler); 41 SkASSERT(fSwizzler);
42 return fSwizzler; 42 return fSwizzler;
43 } 43 }
44 void allocateStorage(const SkImageInfo& dstInfo); 44 void allocateStorage(const SkImageInfo& dstInfo);
45 45
46 virtual int readRows(const SkImageInfo& dstInfo, void* dst, size_t rowBytes, int count, 46 virtual int readRows(const SkImageInfo& dstInfo, void* dst, size_t rowBytes, int count,
47 int startRow) = 0; 47 int startRow) = 0;
48 48
49 SkPngCodec(int width, int height, const SkEncodedInfo&, SkStream*, SkPngChun kReader*, 49 SkPngCodec(const SkEncodedInfo&, const SkImageInfo&, SkStream*, SkPngChunkRe ader*,
50 png_structp, png_infop, int, int, sk_sp<SkColorSpace>); 50 png_structp, png_infop, int, int);
51 51
52 SkAutoTUnref<SkPngChunkReader> fPngChunkReader; 52 SkAutoTUnref<SkPngChunkReader> fPngChunkReader;
53 png_structp fPng_ptr; 53 png_structp fPng_ptr;
54 png_infop fInfo_ptr; 54 png_infop fInfo_ptr;
55 55
56 // These are stored here so they can be used both by normal decoding and sca nline decoding. 56 // These are stored here so they can be used both by normal decoding and sca nline decoding.
57 SkAutoTUnref<SkColorTable> fColorTable; // May be unpremul. 57 SkAutoTUnref<SkColorTable> fColorTable; // May be unpremul.
58 SkAutoTDelete<SkSwizzler> fSwizzler; 58 SkAutoTDelete<SkSwizzler> fSwizzler;
59 std::unique_ptr<SkColorSpaceXform> fColorXform; 59 std::unique_ptr<SkColorSpaceXform> fColorXform;
60 SkAutoTMalloc<uint8_t> fStorage; 60 SkAutoTMalloc<uint8_t> fStorage;
61 uint8_t* fSwizzlerSrcRow; 61 uint8_t* fSwizzlerSrcRow;
62 uint32_t* fColorXformSrcRow; 62 uint32_t* fColorXformSrcRow;
63 size_t fSrcRowBytes; 63 size_t fSrcRowBytes;
64 64
65 const int fNumberPasses; 65 const int fNumberPasses;
66 int fBitDepth; 66 int fBitDepth;
67 67
68 private: 68 private:
69 bool createColorTable(SkColorType dstColorType, bool premultiply, int* ctabl eCount); 69 bool createColorTable(SkColorType dstColorType, bool premultiply, int* ctabl eCount);
70 void destroyReadStruct(); 70 void destroyReadStruct();
71 71
72 typedef SkCodec INHERITED; 72 typedef SkCodec INHERITED;
73 }; 73 };
OLDNEW
« no previous file with comments | « src/codec/SkCodec.cpp ('k') | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698