aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapProcState_procs.h
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2015-03-17 17:44:06 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-17 17:44:07 -0700
commit0c9b1a8d05ea6ec5dfae0ead854304673d94d2c2 (patch)
treec6df748125f1c6a992900fa98de135a1b17d30b1 /src/core/SkBitmapProcState_procs.h
parent160f24ce0e8d6dd7ca80b78871e063d4f4609cfb (diff)
add kGray_8_SkColorType
patch from issue 1014783003 at patchset 60001 (http://crrev.com/1014783003#ps60001) BUG=skia: TBR= Review URL: https://codereview.chromium.org/1010343002
Diffstat (limited to 'src/core/SkBitmapProcState_procs.h')
-rw-r--r--src/core/SkBitmapProcState_procs.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/SkBitmapProcState_procs.h b/src/core/SkBitmapProcState_procs.h
index 3b4cef3955..a9b87501b4 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