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 "SkCodec.h" | 8 #include "SkCodec.h" |
9 #include "SkColorTable.h" | 9 #include "SkColorTable.h" |
10 #include "SkImageInfo.h" | 10 #include "SkImageInfo.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 Result prepareToDecode(const SkImageInfo& dstInfo, SkPMColor* inputColorPtr, | 123 Result prepareToDecode(const SkImageInfo& dstInfo, SkPMColor* inputColorPtr, |
124 int* inputColorCount, const Options& opts); | 124 int* inputColorCount, const Options& opts); |
125 | 125 |
126 /* | 126 /* |
127 * Initializes the swizzler. | 127 * Initializes the swizzler. |
128 * | 128 * |
129 * @param dstInfo Output image information. Dimensions may have been | 129 * @param dstInfo Output image information. Dimensions may have been |
130 * adjusted if the image frame size does not match the size | 130 * adjusted if the image frame size does not match the size |
131 * indicated in the header. | 131 * indicated in the header. |
132 * @param zeroInit Indicates if destination memory is zero initialized. | 132 * @param zeroInit Indicates if destination memory is zero initialized. |
| 133 * @param subsetLeft Left offset for each row decode. |
| 134 * @param subsetWidth Width of each row decode. |
133 */ | 135 */ |
134 Result initializeSwizzler(const SkImageInfo& dstInfo, ZeroInitialized zeroIn
it); | 136 Result initializeSwizzler(const SkImageInfo& dstInfo, |
| 137 ZeroInitialized zeroInit, int subsetLeft, int subsetWidth); |
135 | 138 |
136 SkSampler* getSampler(bool createIfNecessary) override { return fSwizzler; } | 139 SkSampler* getSampler(bool createIfNecessary) override { return fSwizzler; } |
137 | 140 |
138 /* | 141 /* |
139 * @return true if the read is successful and false if the read fails. | 142 * @return true if the read is successful and false if the read fails. |
140 */ | 143 */ |
141 bool readRow(); | 144 bool readRow(); |
142 | 145 |
143 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opts
, | 146 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opts
, |
144 SkPMColor inputColorPtr[], int* inputColorCount) override; | 147 SkPMColor inputColorPtr[], int* inputColorCount, int subsetLe
ft, |
| 148 int subsetWidth) override; |
145 | 149 |
146 int onGetScanlines(void* dst, int count, size_t rowBytes) override; | 150 int onGetScanlines(void* dst, int count, size_t rowBytes) override; |
147 | 151 |
148 SkScanlineOrder onGetScanlineOrder() const override; | 152 SkScanlineOrder onGetScanlineOrder() const override; |
149 | 153 |
150 /* | 154 /* |
151 * This function cleans up the gif object after the decode completes | 155 * This function cleans up the gif object after the decode completes |
152 * It is used in a SkAutoTCallIProc template | 156 * It is used in a SkAutoTCallIProc template |
153 */ | 157 */ |
154 static void CloseGif(GifFileType* gif); | 158 static void CloseGif(GifFileType* gif); |
(...skipping 22 matching lines...) Expand all Loading... |
177 SkAutoTDeleteArray<uint8_t> fSrcBuffer; | 181 SkAutoTDeleteArray<uint8_t> fSrcBuffer; |
178 const SkIRect fFrameRect; | 182 const SkIRect fFrameRect; |
179 const uint32_t fTransIndex; | 183 const uint32_t fTransIndex; |
180 uint32_t fFillIndex; | 184 uint32_t fFillIndex; |
181 const bool fFrameIsSubset; | 185 const bool fFrameIsSubset; |
182 SkAutoTDelete<SkSwizzler> fSwizzler; | 186 SkAutoTDelete<SkSwizzler> fSwizzler; |
183 SkAutoTUnref<SkColorTable> fColorTable; | 187 SkAutoTUnref<SkColorTable> fColorTable; |
184 | 188 |
185 typedef SkCodec INHERITED; | 189 typedef SkCodec INHERITED; |
186 }; | 190 }; |
OLD | NEW |