Chromium Code Reviews| Index: src/codec/SkSwizzler.h |
| diff --git a/src/codec/SkSwizzler.h b/src/codec/SkSwizzler.h |
| index 2fab7f66b6ea15184c3618304a012a9b4bf4df1c..6272d81194e3841937fc46923fe89c7edb8f8732 100644 |
| --- a/src/codec/SkSwizzler.h |
| +++ b/src/codec/SkSwizzler.h |
| @@ -117,16 +117,22 @@ public: |
| /** |
| * Create a new SkSwizzler. |
| * @param SrcConfig Description of the format of the source. |
| - * @param SkImageInfo dimensions() describe both the src and the dst. |
| - * Other fields describe the dst. |
| + * @param dstInfo describes the destination. |
| * @param ZeroInitialized Whether dst is zero-initialized. The |
| implementation may choose to skip writing zeroes |
| * if set to kYes_ZeroInitialized. |
| + * @param srcWidth is the width of the source. Used to calculate the width samplesize. |
| + * Width sampling is supported by the swizzler, by skipping pixels when |
| + swizzling the row. Height sampling is not supported by the swizzler, |
| + but is implemented in SkScaledCodec. |
| + Sampling in Y can be done by a client with a scanline decoder, |
| + but sampling in X allows the swizzler to skip swizzling pixels and |
| + reading from and writing to memory. |
| * @return A new SkSwizzler or NULL on failure. |
| */ |
| static SkSwizzler* CreateSwizzler(SrcConfig, const SkPMColor* ctable, |
| - const SkImageInfo&, SkCodec::ZeroInitialized); |
| - |
| + const SkImageInfo& dstInfo, SkCodec::ZeroInitialized, |
| + int srcWidth); |
| /** |
| * Fill the remainder of the destination with a single color |
| * |
| @@ -185,11 +191,13 @@ private: |
| * @param deltaSrc if bitsPerPixel % 8 == 0, deltaSrc is bytesPerPixel |
| * else, deltaSrc is bitsPerPixel |
| * @param ctable Colors (used for kIndex source). |
| + * @param offset The offset before the first pixel to sample. |
| + Is in bytes or bits based on what deltaSrc is in. |
| */ |
| typedef ResultAlpha (*RowProc)(void* SK_RESTRICT dstRow, |
| const uint8_t* SK_RESTRICT src, |
| int width, int deltaSrc, |
| - const SkPMColor ctable[]); |
| + const SkPMColor ctable[], int offset); |
|
scroggo
2015/08/07 19:39:49
nit: I might change the order, so it's next to del
emmaleer
2015/08/11 20:10:36
Acknowledged.
|
| const RowProc fRowProc; |
| const SkPMColor* fColorTable; // Unowned pointer |
| @@ -199,9 +207,10 @@ private: |
| // deltaSrc is bitsPerPixel |
| const SkImageInfo fDstInfo; |
| int fCurrY; |
| + const int fX0; // first X coord to sample |
| + const int fSampleX; // step between X samples |
| - SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, |
| - const SkImageInfo& info); |
| - |
| + SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, const SkImageInfo& info, |
| + int sampleX); |
| }; |
| #endif // SkSwizzler_DEFINED |