| Index: src/codec/SkSwizzler.h
|
| diff --git a/src/codec/SkSwizzler.h b/src/codec/SkSwizzler.h
|
| index 7eebe7f98156506ebd4f45837e2021909fc3b972..1c1c7171d202faf6c79ca4ab39b9fac5bf0ee279 100644
|
| --- a/src/codec/SkSwizzler.h
|
| +++ b/src/codec/SkSwizzler.h
|
| @@ -168,12 +168,29 @@ private:
|
| static void SkipLeadingGrayAlphaZerosThen(void* dst, const uint8_t* src, int width, int bpp,
|
| int deltaSrc, int offset, const SkPMColor ctable[]);
|
|
|
| - // May be NULL. We have not implemented optimized functions for all supported transforms.
|
| - const RowProc fFastProc;
|
| - // Always non-NULL. Supports sampling.
|
| + // Always non-NULL. Supports all sample sizes.
|
| const RowProc fSlowProc;
|
| - // The actual RowProc we are using. This depends on if fFastProc is non-NULL and
|
| - // whether or not we are sampling.
|
| +
|
| + // Optimized functions are supported for some conversions at various sample sizes.
|
| + // If a RowProc is NULL, it indicates that the particular conversion at the
|
| + // particular sample size does not have a fast version.
|
| + struct FastProcs {
|
| + FastProcs()
|
| + : fSampleSize1(nullptr)
|
| + , fSampleSize2(nullptr)
|
| + , fSampleSize4(nullptr)
|
| + , fSampleSize8(nullptr)
|
| + {}
|
| +
|
| + RowProc fSampleSize1;
|
| + RowProc fSampleSize2;
|
| + RowProc fSampleSize4;
|
| + RowProc fSampleSize8;
|
| + };
|
| + const FastProcs fFastProcs;
|
| +
|
| + // The actual RowProc we are using. This will be equal to one of the fFastProcs
|
| + // if the appropriate proc is non-NULL. Otherwise, this will be fSlowProc.
|
| RowProc fActualProc;
|
|
|
| const SkPMColor* fColorTable; // Unowned pointer
|
| @@ -262,7 +279,7 @@ private:
|
| // fBPP is bitsPerPixel
|
| const int fDstBPP; // Bytes per pixel for the destination color type
|
|
|
| - SkSwizzler(RowProc fastProc, RowProc proc, const SkPMColor* ctable, int srcOffset,
|
| + SkSwizzler(RowProc proc, const FastProcs& fastProcs, const SkPMColor* ctable, int srcOffset,
|
| int srcWidth, int dstOffset, int dstWidth, int srcBPP, int dstBPP);
|
|
|
| int onSetSampleX(int) override;
|
|
|