blob: 6badd62f1c11cc5594970ced49db70b7a94a3471 [file] [log] [blame]
digit@google.com3ada0ef2012-08-13 14:06:34 +00001/*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8// Define NAME_WRAP(x) before including this header to perform name-wrapping
9// E.g. for ARM NEON, defined it as 'x ## _neon' to ensure all important
10// identifiers have a _neon suffix.
11#ifndef NAME_WRAP
12#error "Please define NAME_WRAP() before including this file"
13#endif
14
digit@google.com3ada0ef2012-08-13 14:06:34 +000015// SRC == 8888
16
17#define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_opaque)(x, y, a, b, c, d, dst)
18
19#define MAKENAME(suffix) NAME_WRAP(S32_opaque_D32 ## suffix)
digit@google.com3ada0ef2012-08-13 14:06:34 +000020#define SRCTYPE SkPMColor
reedad7ae6c2015-06-04 14:12:25 -070021#define CHECKSTATE(state) SkASSERT(4 == state.fPixmap.info().bytesPerPixel()); \
digit@google.com3ada0ef2012-08-13 14:06:34 +000022 SkASSERT(state.fAlphaScale == 256)
23#define RETURNDST(src) src
24#define SRC_TO_FILTER(src) src
25#include "SkBitmapProcState_sample.h"
26
27#undef FILTER_PROC
28#define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_alpha)(x, y, a, b, c, d, dst, alphaScale)
29
30#define MAKENAME(suffix) NAME_WRAP(S32_alpha_D32 ## suffix)
digit@google.com3ada0ef2012-08-13 14:06:34 +000031#define SRCTYPE SkPMColor
reedad7ae6c2015-06-04 14:12:25 -070032#define CHECKSTATE(state) SkASSERT(4 == state.fPixmap.info().bytesPerPixel()); \
digit@google.com3ada0ef2012-08-13 14:06:34 +000033 SkASSERT(state.fAlphaScale < 256)
34#define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale
35#define RETURNDST(src) SkAlphaMulQ(src, alphaScale)
36#define SRC_TO_FILTER(src) src
37#include "SkBitmapProcState_sample.h"
38
reed@google.come4ee35d2012-08-14 13:22:16 +000039#undef NAME_WRAP