| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 * @param deltaSrc bpp * sampleX | 185 * @param deltaSrc bpp * sampleX |
| 186 * @param ctable Colors (used for kIndex source). | 186 * @param ctable Colors (used for kIndex source). |
| 187 * @param offset The offset before the first pixel to sample. | 187 * @param offset The offset before the first pixel to sample. |
| 188 Is in bytes or bits based on what deltaSrc is in. | 188 Is in bytes or bits based on what deltaSrc is in. |
| 189 */ | 189 */ |
| 190 typedef ResultAlpha (*RowProc)(void* SK_RESTRICT dstRow, | 190 typedef ResultAlpha (*RowProc)(void* SK_RESTRICT dstRow, |
| 191 const uint8_t* SK_RESTRICT src, | 191 const uint8_t* SK_RESTRICT src, |
| 192 int dstWidth, int bpp, int deltaSrc, int offs
et, | 192 int dstWidth, int bpp, int deltaSrc, int offs
et, |
| 193 const SkPMColor ctable[]); | 193 const SkPMColor ctable[]); |
| 194 | 194 |
| 195 template <RowProc proc> |
| 196 static ResultAlpha SkipLeading8888ZerosThen(void* SK_RESTRICT dstRow, |
| 197 const uint8_t* SK_RESTRICT src, |
| 198 int dstWidth, int bpp, int delta
Src, int offset, |
| 199 const SkPMColor ctable[]); |
| 200 |
| 195 const RowProc fRowProc; | 201 const RowProc fRowProc; |
| 196 const SkPMColor* fColorTable; // Unowned pointer | 202 const SkPMColor* fColorTable; // Unowned pointer |
| 197 | 203 |
| 198 // Subset Swizzles | 204 // Subset Swizzles |
| 199 // There are two types of subset swizzles that we support. We do not | 205 // There are two types of subset swizzles that we support. We do not |
| 200 // support both at the same time. | 206 // support both at the same time. |
| 201 // TODO: If we want to support partial scanlines for gifs (which may | 207 // TODO: If we want to support partial scanlines for gifs (which may |
| 202 // use frame subsets), we will need to support both subsetting | 208 // use frame subsets), we will need to support both subsetting |
| 203 // modes at the same time. | 209 // modes at the same time. |
| 204 // (1) Partial Scanlines | 210 // (1) Partial Scanlines |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 // fBPP is bitsPerPixel | 285 // fBPP is bitsPerPixel |
| 280 const int fDstBPP; // Bytes per pixel for the destination
color type | 286 const int fDstBPP; // Bytes per pixel for the destination
color type |
| 281 | 287 |
| 282 SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidt
h, int dstOffset, | 288 SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidt
h, int dstOffset, |
| 283 int dstWidth, int srcBPP, int dstBPP); | 289 int dstWidth, int srcBPP, int dstBPP); |
| 284 | 290 |
| 285 int onSetSampleX(int) override; | 291 int onSetSampleX(int) override; |
| 286 | 292 |
| 287 }; | 293 }; |
| 288 #endif // SkSwizzler_DEFINED | 294 #endif // SkSwizzler_DEFINED |
| OLD | NEW |