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 144 matching lines...) Loading... |
155 const uint8_t* SK_RESTRICT src, | 155 const uint8_t* SK_RESTRICT src, |
156 int dstWidth, int bpp, int deltaSrc, int offset, | 156 int dstWidth, int bpp, int deltaSrc, int offset, |
157 const SkPMColor ctable[]); | 157 const SkPMColor ctable[]); |
158 | 158 |
159 template <RowProc Proc> | 159 template <RowProc Proc> |
160 static void SkipLeading8888ZerosThen(void* SK_RESTRICT dstRow, | 160 static void SkipLeading8888ZerosThen(void* SK_RESTRICT dstRow, |
161 const uint8_t* SK_RESTRICT src, | 161 const uint8_t* SK_RESTRICT src, |
162 int dstWidth, int bpp, int deltaSrc, in
t offset, | 162 int dstWidth, int bpp, int deltaSrc, in
t offset, |
163 const SkPMColor ctable[]); | 163 const SkPMColor ctable[]); |
164 | 164 |
165 // May be NULL. We will not always be able to used an optimized function. | 165 // May be NULL. We have not implemented optimized functions for all support
ed transforms. |
166 RowProc fFastProc; | 166 const RowProc fFastProc; |
167 // Always non-NULL. We use this if fFastProc is NULL. | 167 // Always non-NULL. Supports sampling. |
168 const RowProc fProc; | 168 const RowProc fSlowProc; |
| 169 // The actual RowProc we are using. This depends on if fFastProc is non-NUL
L and |
| 170 // whether or not we are sampling. |
| 171 RowProc fActualProc; |
| 172 |
169 const SkPMColor* fColorTable; // Unowned pointer | 173 const SkPMColor* fColorTable; // Unowned pointer |
170 | 174 |
171 // Subset Swizzles | 175 // Subset Swizzles |
172 // There are two types of subset swizzles that we support. We do not | 176 // There are two types of subset swizzles that we support. We do not |
173 // support both at the same time. | 177 // support both at the same time. |
174 // TODO: If we want to support partial scanlines for gifs (which may | 178 // TODO: If we want to support partial scanlines for gifs (which may |
175 // use frame subsets), we will need to support both subsetting | 179 // use frame subsets), we will need to support both subsetting |
176 // modes at the same time. | 180 // modes at the same time. |
177 // (1) Partial Scanlines | 181 // (1) Partial Scanlines |
178 // The client only wants to write a subset of the source pixels | 182 // The client only wants to write a subset of the source pixels |
(...skipping 73 matching lines...) Loading... |
252 // fBPP is bitsPerPixel | 256 // fBPP is bitsPerPixel |
253 const int fDstBPP; // Bytes per pixel for the destination
color type | 257 const int fDstBPP; // Bytes per pixel for the destination
color type |
254 | 258 |
255 SkSwizzler(RowProc fastProc, RowProc proc, const SkPMColor* ctable, int srcO
ffset, | 259 SkSwizzler(RowProc fastProc, RowProc proc, const SkPMColor* ctable, int srcO
ffset, |
256 int srcWidth, int dstOffset, int dstWidth, int srcBPP, int dstBPP); | 260 int srcWidth, int dstOffset, int dstWidth, int srcBPP, int dstBPP); |
257 | 261 |
258 int onSetSampleX(int) override; | 262 int onSetSampleX(int) override; |
259 | 263 |
260 }; | 264 }; |
261 #endif // SkSwizzler_DEFINED | 265 #endif // SkSwizzler_DEFINED |
OLD | NEW |