| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 * @param deltaSrc bpp * sampleX | 147 * @param deltaSrc bpp * sampleX |
| 148 * @param ctable Colors (used for kIndex source). | 148 * @param ctable Colors (used for kIndex source). |
| 149 * @param offset The offset before the first pixel to sample. | 149 * @param offset The offset before the first pixel to sample. |
| 150 Is in bytes or bits based on what deltaSrc is in. | 150 Is in bytes or bits based on what deltaSrc is in. |
| 151 */ | 151 */ |
| 152 typedef void (*RowProc)(void* SK_RESTRICT dstRow, | 152 typedef void (*RowProc)(void* SK_RESTRICT dstRow, |
| 153 const uint8_t* SK_RESTRICT src, | 153 const uint8_t* SK_RESTRICT src, |
| 154 int dstWidth, int bpp, int deltaSrc, int offset, | 154 int dstWidth, int bpp, int deltaSrc, int offset, |
| 155 const SkPMColor ctable[]); | 155 const SkPMColor ctable[]); |
| 156 | 156 |
| 157 template <RowProc Proc> |
| 158 static void SkipLeading8888ZerosThen(void* SK_RESTRICT dstRow, |
| 159 const uint8_t* SK_RESTRICT src, |
| 160 int dstWidth, int bpp, int deltaSrc, in
t offset, |
| 161 const SkPMColor ctable[]); |
| 162 |
| 157 const RowProc fRowProc; | 163 const RowProc fRowProc; |
| 158 const SkPMColor* fColorTable; // Unowned pointer | 164 const SkPMColor* fColorTable; // Unowned pointer |
| 159 | 165 |
| 160 // Subset Swizzles | 166 // Subset Swizzles |
| 161 // There are two types of subset swizzles that we support. We do not | 167 // There are two types of subset swizzles that we support. We do not |
| 162 // support both at the same time. | 168 // support both at the same time. |
| 163 // TODO: If we want to support partial scanlines for gifs (which may | 169 // TODO: If we want to support partial scanlines for gifs (which may |
| 164 // use frame subsets), we will need to support both subsetting | 170 // use frame subsets), we will need to support both subsetting |
| 165 // modes at the same time. | 171 // modes at the same time. |
| 166 // (1) Partial Scanlines | 172 // (1) Partial Scanlines |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // fBPP is bitsPerPixel | 247 // fBPP is bitsPerPixel |
| 242 const int fDstBPP; // Bytes per pixel for the destination
color type | 248 const int fDstBPP; // Bytes per pixel for the destination
color type |
| 243 | 249 |
| 244 SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidt
h, int dstOffset, | 250 SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidt
h, int dstOffset, |
| 245 int dstWidth, int srcBPP, int dstBPP); | 251 int dstWidth, int srcBPP, int dstBPP); |
| 246 | 252 |
| 247 int onSetSampleX(int) override; | 253 int onSetSampleX(int) override; |
| 248 | 254 |
| 249 }; | 255 }; |
| 250 #endif // SkSwizzler_DEFINED | 256 #endif // SkSwizzler_DEFINED |
| OLD | NEW |