Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: src/codec/SkSwizzler.h

Issue 1260673002: SkScaledCodec class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
scroggo 2015/07/27 15:09:19 Must be >= 1
emmaleer 2015/07/27 18:31:39 Acknowledged.
207 */
208 void setSampleX(int sampleX);
205 209
206 private: 210 private:
207 211
208 #ifdef SK_DEBUG 212 #ifdef SK_DEBUG
209 /* 213 /*
210 * 214 *
211 * Keep track of which version of next the caller is using 215 * Keep track of which version of next the caller is using
212 * 216 *
213 */ 217 */
214 enum NextMode { 218 enum NextMode {
(...skipping 15 matching lines...) Expand all
230 * @param y Line of source. 234 * @param y Line of source.
231 * @param ctable Colors (used for kIndex source). 235 * @param ctable Colors (used for kIndex source).
232 */ 236 */
233 typedef ResultAlpha (*RowProc)(void* SK_RESTRICT dstRow, 237 typedef ResultAlpha (*RowProc)(void* SK_RESTRICT dstRow,
234 const uint8_t* SK_RESTRICT src, 238 const uint8_t* SK_RESTRICT src,
235 int width, int deltaSrc, int y, 239 int width, int deltaSrc, int y,
236 const SkPMColor ctable[]); 240 const SkPMColor ctable[]);
237 241
238 const RowProc fRowProc; 242 const RowProc fRowProc;
239 const SkPMColor* fColorTable; // Unowned pointer 243 const SkPMColor* fColorTable; // Unowned pointer
240 const int fDeltaSrc; // if bitsPerPixel % 8 == 0 244 const int fDeltaSrc; // if bitsPerPixel % 8 == 0
scroggo 2015/07/27 15:09:20 Maybe there is a better name for this than "fDelta
emmaleer 2015/07/27 18:31:38 Well fDeltaSrc is always the bytes or bits between
scroggo 2015/07/27 19:29:57 Maybe. I'm fine to leave it as-is for now. It is s
emmaleer 2015/07/28 14:19:16 Acknowledged.
241 // deltaSrc is bytesPerPixel 245 // deltaSrc is bytesPerPixel
242 // else 246 // else
243 // deltaSrc is bitsPerPixel 247 // deltaSrc is bitsPerPixel
244 const SkImageInfo fDstInfo; 248 const SkImageInfo fDstInfo;
245 void* fDstRow; 249 void* fDstRow;
246 const size_t fDstRowBytes; 250 const size_t fDstRowBytes;
247 int fCurrY; 251 int fCurrY;
252 int fX0; // first X coord to sample. Is constan t
scroggo 2015/07/27 15:09:19 These are actually not const - they are modified i
emmaleer 2015/07/27 18:31:38 Acknowledged.
253 int fSampleX; // step between X samples. Is constant
248 254
249 SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, 255 SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc,
250 const SkImageInfo& info, void* dst, size_t rowBytes); 256 const SkImageInfo& info, void* dst, size_t rowBytes);
251 257
252 }; 258 };
253 #endif // SkSwizzler_DEFINED 259 #endif // SkSwizzler_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698