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

Unified Diff: src/core/SkBitmapProcState_procs.h

Issue 1010343002: add kGray_8_SkColorType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « src/core/SkBitmapProcState.cpp ('k') | src/core/SkConfig8888.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcState_procs.h
diff --git a/src/core/SkBitmapProcState_procs.h b/src/core/SkBitmapProcState_procs.h
index 3b4cef395506cc197774f90399458c3bc13ae7a2..a9b87501b42e12876d95b62bfb18213eb9a03ebe 100644
--- a/src/core/SkBitmapProcState_procs.h
+++ b/src/core/SkBitmapProcState_procs.h
@@ -224,6 +224,25 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define SRC_TO_FILTER(src) src
#include "SkBitmapProcState_sample.h"
+// SRC == Gray8
+
+#undef FILTER_PROC
+#define FILTER_PROC(x, y, a, b, c, d, dst) \
+ do { \
+ unsigned tmp = Filter_8(x, y, a, b, c, d); \
+ SkPMColor color = SkPackARGB32(0xFF, tmp, tmp, tmp); \
+ *(dst) = SkAlphaMulQ(color, alphaScale); \
+ } while (0)
+
+#define MAKENAME(suffix) NAME_WRAP(SG8_alpha_D32 ## suffix)
+#define DSTSIZE 32
+#define SRCTYPE uint8_t
+#define CHECKSTATE(state) SkASSERT(kGray_8_SkColorType == state.fBitmap->colorType());
+#define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale
+#define RETURNDST(src) SkAlphaMulQ(SkPackARGB32(0xFF, src, src, src), alphaScale)
+#define SRC_TO_FILTER(src) src
+#include "SkBitmapProcState_sample.h"
+
/*****************************************************************************
*
* D16 functions
« no previous file with comments | « src/core/SkBitmapProcState.cpp ('k') | src/core/SkConfig8888.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698