OLD | NEW |
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 "SkBmpCodec.h" | 8 #include "SkBmpCodec.h" |
9 #include "SkColorTable.h" | 9 #include "SkColorTable.h" |
10 #include "SkImageInfo.h" | 10 #include "SkImageInfo.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 SkASSERT(fSwizzler); | 63 SkASSERT(fSwizzler); |
64 return fSwizzler; | 64 return fSwizzler; |
65 } | 65 } |
66 | 66 |
67 private: | 67 private: |
68 | 68 |
69 /* | 69 /* |
70 * Creates the color table | 70 * Creates the color table |
71 * Sets colorCount to the new color count if it is non-nullptr | 71 * Sets colorCount to the new color count if it is non-nullptr |
72 */ | 72 */ |
73 bool createColorTable(SkAlphaType alphaType, int* colorCount); | 73 bool createColorTable(SkColorType colorType, SkAlphaType alphaType, int* col
orCount); |
74 | 74 |
75 void initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts); | 75 void initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts); |
76 | 76 |
77 int decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, | 77 int decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, |
78 const Options& opts) override; | 78 const Options& opts) override; |
79 | 79 |
80 /* | 80 /* |
81 * @param stream This may be a pointer to the stream owned by the parent SkC
odec | 81 * @param stream This may be a pointer to the stream owned by the parent SkC
odec |
82 * or a sub-stream of the stream owned by the parent SkCodec. | 82 * or a sub-stream of the stream owned by the parent SkCodec. |
83 * Either way, this stream is unowned. | 83 * Either way, this stream is unowned. |
84 */ | 84 */ |
85 void decodeIcoMask(SkStream* stream, const SkImageInfo& dstInfo, void* dst,
size_t dstRowBytes); | 85 void decodeIcoMask(SkStream* stream, const SkImageInfo& dstInfo, void* dst,
size_t dstRowBytes); |
86 | 86 |
87 SkAutoTUnref<SkColorTable> fColorTable; // owned | 87 SkAutoTUnref<SkColorTable> fColorTable; // owned |
88 // fNumColors is the number specified in the header, or 0 if not present in
the header. | 88 // fNumColors is the number specified in the header, or 0 if not present in
the header. |
89 const uint32_t fNumColors; | 89 const uint32_t fNumColors; |
90 const uint32_t fBytesPerColor; | 90 const uint32_t fBytesPerColor; |
91 const uint32_t fOffset; | 91 const uint32_t fOffset; |
92 SkAutoTDelete<SkSwizzler> fSwizzler; | 92 SkAutoTDelete<SkSwizzler> fSwizzler; |
93 SkAutoTDeleteArray<uint8_t> fSrcBuffer; | 93 SkAutoTDeleteArray<uint8_t> fSrcBuffer; |
94 const bool fIsOpaque; | 94 const bool fIsOpaque; |
95 const bool fInIco; | 95 const bool fInIco; |
96 const size_t fAndMaskRowBytes; // only used for fInIc
o decodes | 96 const size_t fAndMaskRowBytes; // only used for fInIc
o decodes |
97 | 97 |
98 typedef SkBmpCodec INHERITED; | 98 typedef SkBmpCodec INHERITED; |
99 }; | 99 }; |
OLD | NEW |