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

Unified Diff: include/core/SkXfermode.h

Issue 1721223002: simplify/unify xferproc api (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « gm/xfer4f.cpp ('k') | src/core/SkBitmapProcShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkXfermode.h
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h
index 04630e75f6901d983a24bcdad082f169b69c96a2..2c4da5f999fd17b1737a2f258e2bbb336671750a 100644
--- a/include/core/SkXfermode.h
+++ b/include/core/SkXfermode.h
@@ -220,38 +220,23 @@ public:
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
SK_DEFINE_FLATTENABLE_TYPE(SkXfermode)
- enum PM4fFlags {
- kSrcIsOpaque_PM4fFlag = 1 << 0,
- kDstIsSRGB_PM4fFlag = 1 << 1,
+ enum D32Flags {
+ kSrcIsOpaque_D32Flag = 1 << 0,
+ kSrcIsSingle_D32Flag = 1 << 1,
+ kDstIsSRGB_D32Flag = 1 << 2,
};
- struct PM4fState {
- const SkXfermode* fXfer;
- uint32_t fFlags;
+ typedef void (*D32Proc)(const SkXfermode*, uint32_t dst[], const SkPM4f src[],
+ int count, const SkAlpha coverage[]);
+ static D32Proc GetD32Proc(SkXfermode*, uint32_t flags);
+
+ enum D64Flags {
+ kSrcIsOpaque_D64Flag = 1 << 0,
+ kSrcIsSingle_D64Flag = 1 << 1,
+ kDstIsFloat16_D64Flag = 1 << 2, // else U16 bit components
};
- typedef void (*PM4fProc1)(const PM4fState&, uint32_t dst[], const SkPM4f& src,
- int count, const SkAlpha coverage[]);
- typedef void (*PM4fProcN)(const PM4fState&, uint32_t dst[], const SkPM4f src[],
- int count, const SkAlpha coverage[]);
-
- static PM4fProc1 GetPM4fProc1(Mode, uint32_t flags);
- static PM4fProcN GetPM4fProcN(Mode, uint32_t flags);
- virtual PM4fProc1 getPM4fProc1(uint32_t flags) const;
- virtual PM4fProcN getPM4fProcN(uint32_t flags) const;
-
- enum U64Flags {
- kSrcIsOpaque_U64Flag = 1 << 0,
- kDstIsFloat16_U64Flag = 1 << 1, // else U16 bit components
- };
- struct U64State {
- const SkXfermode* fXfer;
- uint32_t fFlags;
- };
- typedef void (*U64Proc1)(const U64State&, uint64_t dst[], const SkPM4f& src, int count,
- const SkAlpha coverage[]);
- typedef void (*U64ProcN)(const U64State&, uint64_t dst[], const SkPM4f src[], int count,
- const SkAlpha coverage[]);
- static U64Proc1 GetU64Proc1(Mode, uint32_t flags);
- static U64ProcN GetU64ProcN(Mode, uint32_t flags);
+ typedef void (*D64Proc)(const SkXfermode*, uint64_t dst[], const SkPM4f src[], int count,
+ const SkAlpha coverage[]);
+ static D64Proc GetD64Proc(SkXfermode*, uint32_t flags);
enum LCDFlags {
kSrcIsOpaque_LCDFlag = 1 << 0, // else src(s) may have alpha < 1
@@ -275,6 +260,9 @@ protected:
*/
virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const;
+ virtual D32Proc onGetD32Proc(uint32_t flags) const;
+ virtual D64Proc onGetD64Proc(uint32_t flags) const;
+
private:
enum {
kModeCount = kLastMode + 1
« no previous file with comments | « gm/xfer4f.cpp ('k') | src/core/SkBitmapProcShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698