Chromium Code Reviews| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 /** | 115 /** |
| 116 * Create a new SkSwizzler. | 116 * Create a new SkSwizzler. |
| 117 * @param SrcConfig Description of the format of the source. | 117 * @param SrcConfig Description of the format of the source. |
| 118 * @param SkImageInfo dimensions() describe both the src and the dst. | 118 * @param SkImageInfo dimensions() describe both the src and the dst. |
| 119 * Other fields describe the dst. | 119 * Other fields describe the dst. |
| 120 * @param dst Destination to write pixels. Must match info and dstRowBytes | 120 * @param dst Destination to write pixels. Must match info and dstRowBytes |
| 121 * @param dstRowBytes rowBytes for dst. | 121 * @param dstRowBytes rowBytes for dst. |
| 122 * @param ZeroInitialized Whether dst is zero-initialized. The | 122 * @param ZeroInitialized Whether dst is zero-initialized. The |
| 123 implementation may choose to skip writing zeroes | 123 implementation may choose to skip writing zeroes |
| 124 * if set to kYes_ZeroInitialized. | 124 * if set to kYes_ZeroInitialized. |
| 125 * @param sampleX the step between samples in the x direction. | |
|
scroggo
2015/07/28 15:58:10
As stated elsewhere, I think we should consider co
emmaleer
2015/07/29 21:55:08
SampleX is no longer needed to be stored in the op
| |
| 125 * @return A new SkSwizzler or NULL on failure. | 126 * @return A new SkSwizzler or NULL on failure. |
| 126 */ | 127 */ |
| 127 static SkSwizzler* CreateSwizzler(SrcConfig, const SkPMColor* ctable, | 128 static SkSwizzler* CreateSwizzler(SrcConfig, const SkPMColor* ctable, |
| 128 const SkImageInfo&, void* dst, | 129 const SkImageInfo&, void* dst, |
| 129 size_t dstRowBytes, | 130 size_t dstRowBytes, |
| 130 SkCodec::ZeroInitialized); | 131 SkCodec::ZeroInitialized, int sampleX); |
| 131 | 132 |
| 132 /** | 133 /** |
| 133 * Fill the remainder of the destination with a single color | 134 * Fill the remainder of the destination with a single color |
| 134 * | 135 * |
| 135 * @param dstStartRow | 136 * @param dstStartRow |
| 136 * The destination row to fill from. | 137 * The destination row to fill from. |
| 137 * | 138 * |
| 138 * @param numRows | 139 * @param numRows |
| 139 * The number of rows to fill. | 140 * The number of rows to fill. |
| 140 * | 141 * |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 const RowProc fRowProc; | 239 const RowProc fRowProc; |
| 239 const SkPMColor* fColorTable; // Unowned pointer | 240 const SkPMColor* fColorTable; // Unowned pointer |
| 240 const int fDeltaSrc; // if bitsPerPixel % 8 == 0 | 241 const int fDeltaSrc; // if bitsPerPixel % 8 == 0 |
| 241 // deltaSrc is bytesPerPixel | 242 // deltaSrc is bytesPerPixel |
| 242 // else | 243 // else |
| 243 // deltaSrc is bitsPerPixel | 244 // deltaSrc is bitsPerPixel |
| 244 const SkImageInfo fDstInfo; | 245 const SkImageInfo fDstInfo; |
| 245 void* fDstRow; | 246 void* fDstRow; |
| 246 const size_t fDstRowBytes; | 247 const size_t fDstRowBytes; |
| 247 int fCurrY; | 248 int fCurrY; |
| 249 int fX0; // first X coord to sample | |
| 250 int fSampleX; // step between X samples | |
|
scroggo
2015/07/28 15:58:10
This can now be const.
fX0 can also be const, if
emmaleer
2015/07/29 21:55:08
SampleX is set to srcWidth / dstWidth in initializ
| |
| 248 | 251 |
| 249 SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, | 252 SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, |
| 250 const SkImageInfo& info, void* dst, size_t rowBytes); | 253 const SkImageInfo& info, void* dst, size_t rowBytes, int sampleX) ; |
| 251 | 254 |
| 252 }; | 255 }; |
| 253 #endif // SkSwizzler_DEFINED | 256 #endif // SkSwizzler_DEFINED |
| OLD | NEW |