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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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> | 157 template <RowProc Proc> |
158 static void SkipLeading8888ZerosThen(void* SK_RESTRICT dstRow, | 158 static void SkipLeading8888ZerosThen(void* SK_RESTRICT dstRow, |
159 const uint8_t* SK_RESTRICT src, | 159 const uint8_t* SK_RESTRICT src, |
160 int dstWidth, int bpp, int deltaSrc, in
t offset, | 160 int dstWidth, int bpp, int deltaSrc, in
t offset, |
161 const SkPMColor ctable[]); | 161 const SkPMColor ctable[]); |
162 | 162 |
163 const RowProc fRowProc; | 163 // May be NULL. We will not always be able to used an optimized function. |
| 164 RowProc fFastProc; |
| 165 // Always non-NULL. We use this if fFastProc is NULL. |
| 166 const RowProc fProc; |
164 const SkPMColor* fColorTable; // Unowned pointer | 167 const SkPMColor* fColorTable; // Unowned pointer |
165 | 168 |
166 // Subset Swizzles | 169 // Subset Swizzles |
167 // There are two types of subset swizzles that we support. We do not | 170 // There are two types of subset swizzles that we support. We do not |
168 // support both at the same time. | 171 // support both at the same time. |
169 // TODO: If we want to support partial scanlines for gifs (which may | 172 // TODO: If we want to support partial scanlines for gifs (which may |
170 // use frame subsets), we will need to support both subsetting | 173 // use frame subsets), we will need to support both subsetting |
171 // modes at the same time. | 174 // modes at the same time. |
172 // (1) Partial Scanlines | 175 // (1) Partial Scanlines |
173 // The client only wants to write a subset of the source pixels | 176 // The client only wants to write a subset of the source pixels |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 int fAllocatedWidth; | 243 int fAllocatedWidth; |
241 | 244 |
242 int fSampleX; // Step between X samples | 245 int fSampleX; // Step between X samples |
243 const int fSrcBPP; // Bits/bytes per pixel for the SrcCon
fig | 246 const int fSrcBPP; // Bits/bytes per pixel for the SrcCon
fig |
244 // if bitsPerPixel % 8 == 0 | 247 // if bitsPerPixel % 8 == 0 |
245 // fBPP is bytesPerPixel | 248 // fBPP is bytesPerPixel |
246 // else | 249 // else |
247 // fBPP is bitsPerPixel | 250 // fBPP is bitsPerPixel |
248 const int fDstBPP; // Bytes per pixel for the destination
color type | 251 const int fDstBPP; // Bytes per pixel for the destination
color type |
249 | 252 |
250 SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidt
h, int dstOffset, | 253 SkSwizzler(RowProc fastProc, RowProc proc, const SkPMColor* ctable, int srcO
ffset, |
251 int dstWidth, int srcBPP, int dstBPP); | 254 int srcWidth, int dstOffset, int dstWidth, int srcBPP, int dstBPP); |
252 | 255 |
253 int onSetSampleX(int) override; | 256 int onSetSampleX(int) override; |
254 | 257 |
255 }; | 258 }; |
256 #endif // SkSwizzler_DEFINED | 259 #endif // SkSwizzler_DEFINED |
OLD | NEW |