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 #ifndef SkSwizzler_DEFINED | 8 #ifndef SkSwizzler_DEFINED |
9 #define SkSwizzler_DEFINED | 9 #define SkSwizzler_DEFINED |
10 | 10 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
156 | 156 |
157 /** | 157 /** |
158 * Implement fill using a custom width. | 158 * Implement fill using a custom width. |
159 */ | 159 */ |
160 void fill(const SkImageInfo& info, void* dst, size_t rowBytes, uint32_t colo rOrIndex, | 160 void fill(const SkImageInfo& info, void* dst, size_t rowBytes, uint32_t colo rOrIndex, |
161 SkCodec::ZeroInitialized zeroInit) override { | 161 SkCodec::ZeroInitialized zeroInit) override { |
162 const SkImageInfo fillInfo = info.makeWH(fAllocatedWidth, info.height()) ; | 162 const SkImageInfo fillInfo = info.makeWH(fAllocatedWidth, info.height()) ; |
163 SkSampler::Fill(fillInfo, dst, rowBytes, colorOrIndex, zeroInit); | 163 SkSampler::Fill(fillInfo, dst, rowBytes, colorOrIndex, zeroInit); |
164 } | 164 } |
165 | 165 |
166 /** | |
167 * Getter for fSampleX. | |
scroggo
2015/12/03 19:39:25
This line doesn't state anything that cannot be gl
msarett
2015/12/03 19:54:15
Done.
| |
168 * | |
169 * Currently used by SkBmpStandardCodec for Bmp-in-Ico decodes. Ideally, t he | |
170 * subclasses of SkCodec would have no knowledge of sampling, but this allo ws | |
171 * us to apply a transparency mask to pixels after swizzling. | |
172 */ | |
173 int sampleX() const { return fSampleX; } | |
174 | |
166 private: | 175 private: |
167 | 176 |
168 /** | 177 /** |
169 * Method for converting raw data to Skia pixels. | 178 * Method for converting raw data to Skia pixels. |
170 * @param dstRow Row in which to write the resulting pixels. | 179 * @param dstRow Row in which to write the resulting pixels. |
171 * @param src Row of src data, in format specified by SrcConfig | 180 * @param src Row of src data, in format specified by SrcConfig |
172 * @param dstWidth Width in pixels of the destination | 181 * @param dstWidth Width in pixels of the destination |
173 * @param bpp if bitsPerPixel % 8 == 0, deltaSrc is bytesPerPixel | 182 * @param bpp if bitsPerPixel % 8 == 0, deltaSrc is bytesPerPixel |
174 * else, deltaSrc is bitsPerPixel | 183 * else, deltaSrc is bitsPerPixel |
175 * @param deltaSrc bpp * sampleX | 184 * @param deltaSrc bpp * sampleX |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 // fBPP is bitsPerPixel | 278 // fBPP is bitsPerPixel |
270 const int fDstBPP; // Bytes per pixel for the destination color type | 279 const int fDstBPP; // Bytes per pixel for the destination color type |
271 | 280 |
272 SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidt h, int dstOffset, | 281 SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidt h, int dstOffset, |
273 int dstWidth, int srcBPP, int dstBPP); | 282 int dstWidth, int srcBPP, int dstBPP); |
274 | 283 |
275 int onSetSampleX(int) override; | 284 int onSetSampleX(int) override; |
276 | 285 |
277 }; | 286 }; |
278 #endif // SkSwizzler_DEFINED | 287 #endif // SkSwizzler_DEFINED |
OLD | NEW |