| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 * this allows us to apply a transparency mask to pixels after swizzling. | 71 * this allows us to apply a transparency mask to pixels after swizzling. |
| 72 */ | 72 */ |
| 73 int sampleX() const { return fSampleX; } | 73 int sampleX() const { return fSampleX; } |
| 74 | 74 |
| 75 /** | 75 /** |
| 76 * Returns the actual number of pixels written to destination memory, takin
g | 76 * Returns the actual number of pixels written to destination memory, takin
g |
| 77 * scaling, subsetting, and partial frames into account. | 77 * scaling, subsetting, and partial frames into account. |
| 78 */ | 78 */ |
| 79 int swizzleWidth() const { return fSwizzleWidth; } | 79 int swizzleWidth() const { return fSwizzleWidth; } |
| 80 | 80 |
| 81 /** |
| 82 * Returns the byte offset at which we write to destination memory, taking |
| 83 * scaling, subsetting, and partial frames into account. |
| 84 */ |
| 85 size_t swizzleOffsetBytes() const { return fDstOffsetBytes; } |
| 86 |
| 81 private: | 87 private: |
| 82 | 88 |
| 83 /** | 89 /** |
| 84 * Method for converting raw data to Skia pixels. | 90 * Method for converting raw data to Skia pixels. |
| 85 * @param dstRow Row in which to write the resulting pixels. | 91 * @param dstRow Row in which to write the resulting pixels. |
| 86 * @param src Row of src data, in format specified by SrcConfig | 92 * @param src Row of src data, in format specified by SrcConfig |
| 87 * @param dstWidth Width in pixels of the destination | 93 * @param dstWidth Width in pixels of the destination |
| 88 * @param bpp if bitsPerPixel % 8 == 0, deltaSrc is bytesPerPixel | 94 * @param bpp if bitsPerPixel % 8 == 0, deltaSrc is bytesPerPixel |
| 89 * else, deltaSrc is bitsPerPixel | 95 * else, deltaSrc is bitsPerPixel |
| 90 * @param deltaSrc bpp * sampleX | 96 * @param deltaSrc bpp * sampleX |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // fBPP is bitsPerPixel | 207 // fBPP is bitsPerPixel |
| 202 const int fDstBPP; // Bytes per pixel for the destination
color type | 208 const int fDstBPP; // Bytes per pixel for the destination
color type |
| 203 | 209 |
| 204 SkSwizzler(RowProc fastProc, RowProc proc, const SkPMColor* ctable, int srcO
ffset, | 210 SkSwizzler(RowProc fastProc, RowProc proc, const SkPMColor* ctable, int srcO
ffset, |
| 205 int srcWidth, int dstOffset, int dstWidth, int srcBPP, int dstBPP); | 211 int srcWidth, int dstOffset, int dstWidth, int srcBPP, int dstBPP); |
| 206 | 212 |
| 207 int onSetSampleX(int) override; | 213 int onSetSampleX(int) override; |
| 208 | 214 |
| 209 }; | 215 }; |
| 210 #endif // SkSwizzler_DEFINED | 216 #endif // SkSwizzler_DEFINED |
| OLD | NEW |