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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 /** | 195 /** |
196 * Get the next destination row to decode to | 196 * Get the next destination row to decode to |
197 */ | 197 */ |
198 void* getDstRow() { | 198 void* getDstRow() { |
199 // kDesignateRow_NextMode does not update the fDstRow ptr. This functio
n is | 199 // kDesignateRow_NextMode does not update the fDstRow ptr. This functio
n is |
200 // unnecessary in that case since fDstRow will always be equal to the po
inter | 200 // unnecessary in that case since fDstRow will always be equal to the po
inter |
201 // passed to CreateSwizzler(). | 201 // passed to CreateSwizzler(). |
202 SkASSERT(kDesignateRow_NextMode != fNextMode); | 202 SkASSERT(kDesignateRow_NextMode != fNextMode); |
203 return fDstRow; | 203 return fDstRow; |
204 } | 204 } |
| 205 /** |
| 206 * set the sample size in the x direction |
| 207 * only support down sampling, sampleX >= 1 |
| 208 */ |
| 209 void setSampleX(int sampleX); |
205 | 210 |
206 private: | 211 private: |
207 | 212 |
208 #ifdef SK_DEBUG | 213 #ifdef SK_DEBUG |
209 /* | 214 /* |
210 * | 215 * |
211 * Keep track of which version of next the caller is using | 216 * Keep track of which version of next the caller is using |
212 * | 217 * |
213 */ | 218 */ |
214 enum NextMode { | 219 enum NextMode { |
(...skipping 23 matching lines...) Expand all Loading... |
238 const RowProc fRowProc; | 243 const RowProc fRowProc; |
239 const SkPMColor* fColorTable; // Unowned pointer | 244 const SkPMColor* fColorTable; // Unowned pointer |
240 const int fDeltaSrc; // if bitsPerPixel % 8 == 0 | 245 const int fDeltaSrc; // if bitsPerPixel % 8 == 0 |
241 // deltaSrc is bytesPerPixel | 246 // deltaSrc is bytesPerPixel |
242 // else | 247 // else |
243 // deltaSrc is bitsPerPixel | 248 // deltaSrc is bitsPerPixel |
244 const SkImageInfo fDstInfo; | 249 const SkImageInfo fDstInfo; |
245 void* fDstRow; | 250 void* fDstRow; |
246 const size_t fDstRowBytes; | 251 const size_t fDstRowBytes; |
247 int fCurrY; | 252 int fCurrY; |
| 253 int fX0; // first X coord to sample |
| 254 int fSampleX; // step between X samples |
248 | 255 |
249 SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, | 256 SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, |
250 const SkImageInfo& info, void* dst, size_t rowBytes); | 257 const SkImageInfo& info, void* dst, size_t rowBytes); |
251 | 258 |
252 }; | 259 }; |
253 #endif // SkSwizzler_DEFINED | 260 #endif // SkSwizzler_DEFINED |
OLD | NEW |