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

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

Issue 1563393002: Use SkOpts routines in SkSwizzler (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 * @param deltaSrc bpp * sampleX 185 * @param deltaSrc bpp * sampleX
186 * @param ctable Colors (used for kIndex source). 186 * @param ctable Colors (used for kIndex source).
187 * @param offset The offset before the first pixel to sample. 187 * @param offset The offset before the first pixel to sample.
188 Is in bytes or bits based on what deltaSrc is in. 188 Is in bytes or bits based on what deltaSrc is in.
189 */ 189 */
190 typedef ResultAlpha (*RowProc)(void* SK_RESTRICT dstRow, 190 typedef ResultAlpha (*RowProc)(void* SK_RESTRICT dstRow,
191 const uint8_t* SK_RESTRICT src, 191 const uint8_t* SK_RESTRICT src,
192 int dstWidth, int bpp, int deltaSrc, int offs et, 192 int dstWidth, int bpp, int deltaSrc, int offs et,
193 const SkPMColor ctable[]); 193 const SkPMColor ctable[]);
194 194
195 const RowProc fRowProc; 195 RowProc fRowProc;
196 // We use this as a fallback. If the client requests sampling, we will
197 // most likely need to use this simpler row proc in place of a more highly
198 // optimized version.
199 const RowProc fScalarRowProc;
mtklein 2016/01/08 15:20:19 Scalar sounds like SkScalar to me. What about jus
msarett 2016/01/11 20:33:25 Done.
196 const SkPMColor* fColorTable; // Unowned pointer 200 const SkPMColor* fColorTable; // Unowned pointer
197 201
198 // Subset Swizzles 202 // Subset Swizzles
199 // There are two types of subset swizzles that we support. We do not 203 // There are two types of subset swizzles that we support. We do not
200 // support both at the same time. 204 // support both at the same time.
201 // TODO: If we want to support partial scanlines for gifs (which may 205 // TODO: If we want to support partial scanlines for gifs (which may
202 // use frame subsets), we will need to support both subsetting 206 // use frame subsets), we will need to support both subsetting
203 // modes at the same time. 207 // modes at the same time.
204 // (1) Partial Scanlines 208 // (1) Partial Scanlines
205 // The client only wants to write a subset of the source pixels 209 // The client only wants to write a subset of the source pixels
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 int fAllocatedWidth; 276 int fAllocatedWidth;
273 277
274 int fSampleX; // Step between X samples 278 int fSampleX; // Step between X samples
275 const int fSrcBPP; // Bits/bytes per pixel for the SrcCon fig 279 const int fSrcBPP; // Bits/bytes per pixel for the SrcCon fig
276 // if bitsPerPixel % 8 == 0 280 // if bitsPerPixel % 8 == 0
277 // fBPP is bytesPerPixel 281 // fBPP is bytesPerPixel
278 // else 282 // else
279 // fBPP is bitsPerPixel 283 // fBPP is bitsPerPixel
280 const int fDstBPP; // Bytes per pixel for the destination color type 284 const int fDstBPP; // Bytes per pixel for the destination color type
281 285
282 SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidt h, int dstOffset, 286 SkSwizzler(RowProc optProc, RowProc scalarProc, const SkPMColor* ctable, int srcOffset,
283 int dstWidth, int srcBPP, int dstBPP); 287 int srcWidth, int dstOffset, int dstWidth, int srcBPP, int dstBPP);
284 288
285 int onSetSampleX(int) override; 289 int onSetSampleX(int) override;
286 290
287 }; 291 };
288 #endif // SkSwizzler_DEFINED 292 #endif // SkSwizzler_DEFINED
OLDNEW
« no previous file with comments | « gyp/codec.gyp ('k') | src/codec/SkSwizzler.cpp » ('j') | src/codec/SkSwizzler.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698