Chromium Code Reviews| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 */ | 181 */ |
| 182 ResultAlpha swizzle(void* dst, const uint8_t* SK_RESTRICT src); | 182 ResultAlpha swizzle(void* dst, const uint8_t* SK_RESTRICT src); |
| 183 | 183 |
| 184 private: | 184 private: |
| 185 | 185 |
| 186 /** | 186 /** |
| 187 * Method for converting raw data to Skia pixels. | 187 * Method for converting raw data to Skia pixels. |
| 188 * @param dstRow Row in which to write the resulting pixels. | 188 * @param dstRow Row in which to write the resulting pixels. |
| 189 * @param src Row of src data, in format specified by SrcConfig | 189 * @param src Row of src data, in format specified by SrcConfig |
| 190 * @param dstWidth Width in pixels of the destination | 190 * @param dstWidth Width in pixels of the destination |
| 191 * @param deltaSrc if bitsPerPixel % 8 == 0, deltaSrc is bytesPerPixel | 191 * @param bpp if bitsPerPixel % 8 == 0, deltaSrc is bytesPerPixel |
| 192 * else, deltaSrc is bitsPerPixel | 192 * else, deltaSrc is bitsPerPixel |
| 193 * @param deltaSrc bpp * sampleX | |
|
scroggo
2015/08/26 22:40:09
It seems a little weird to me that these two param
msarett
2015/08/27 15:00:27
I agree that it it strange - but I think this is b
scroggo
2015/08/27 20:14:22
Agreed.
| |
| 193 * @param ctable Colors (used for kIndex source). | 194 * @param ctable Colors (used for kIndex source). |
| 194 * @param offset The offset before the first pixel to sample. | 195 * @param offset The offset before the first pixel to sample. |
| 195 Is in bytes or bits based on what deltaSrc is in. | 196 Is in bytes or bits based on what deltaSrc is in. |
| 196 */ | 197 */ |
| 197 typedef ResultAlpha (*RowProc)(void* SK_RESTRICT dstRow, | 198 typedef ResultAlpha (*RowProc)(void* SK_RESTRICT dstRow, |
| 198 const uint8_t* SK_RESTRICT src, | 199 const uint8_t* SK_RESTRICT src, |
| 199 int dstWidth, int deltaSrc, int offset, | 200 int dstWidth, int bpp, int deltaSrc, int offs et, |
| 200 const SkPMColor ctable[]); | 201 const SkPMColor ctable[]); |
| 201 | 202 |
| 202 const RowProc fRowProc; | 203 const RowProc fRowProc; |
| 203 const SkPMColor* fColorTable; // Unowned pointer | 204 const SkPMColor* fColorTable; // Unowned pointer |
| 204 const int fDeltaSrc; // if bitsPerPixel % 8 == 0 | 205 const int fDeltaSrc; // if bitsPerPixel % 8 == 0 |
| 205 // deltaSrc is bytesPerPixel | 206 // deltaSrc is bytesPerPixel |
| 206 // else | 207 // else |
| 207 // deltaSrc is bitsPerPixel | 208 // deltaSrc is bitsPerPixel |
| 208 const SkImageInfo fDstInfo; | 209 const SkImageInfo fDstInfo; |
| 209 int fCurrY; | 210 int fCurrY; |
| 210 const int fX0; // first X coord to sample | 211 const int fX0; // first X coord to sample |
| 211 const int fSampleX; // step between X samples | 212 const int fSampleX; // step between X samples |
| 212 | 213 |
| 213 SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, const SkImag eInfo& info, | 214 SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, const SkImag eInfo& info, |
| 214 int sampleX); | 215 int sampleX); |
| 215 }; | 216 }; |
| 216 #endif // SkSwizzler_DEFINED | 217 #endif // SkSwizzler_DEFINED |
| OLD | NEW |