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

Unified Diff: src/codec/SkSwizzler.h

Issue 1680743005: NEON Optimized RGBA->PMColor sampling in SkSwizzler (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Share implementations for sampleSize 4 and 8 Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/codec/SkSwizzler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | src/codec/SkSwizzler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698