digit@google.com | 3ada0ef | 2012-08-13 14:06:34 +0000 | [diff] [blame] | 1 | /* |
| 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.com | 3ada0ef | 2012-08-13 14:06:34 +0000 | [diff] [blame] | 15 | // 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.com | 3ada0ef | 2012-08-13 14:06:34 +0000 | [diff] [blame] | 20 | #define SRCTYPE SkPMColor |
reed | ad7ae6c | 2015-06-04 14:12:25 -0700 | [diff] [blame] | 21 | #define CHECKSTATE(state) SkASSERT(4 == state.fPixmap.info().bytesPerPixel()); \ |
digit@google.com | 3ada0ef | 2012-08-13 14:06:34 +0000 | [diff] [blame] | 22 | 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.com | 3ada0ef | 2012-08-13 14:06:34 +0000 | [diff] [blame] | 31 | #define SRCTYPE SkPMColor |
reed | ad7ae6c | 2015-06-04 14:12:25 -0700 | [diff] [blame] | 32 | #define CHECKSTATE(state) SkASSERT(4 == state.fPixmap.info().bytesPerPixel()); \ |
digit@google.com | 3ada0ef | 2012-08-13 14:06:34 +0000 | [diff] [blame] | 33 | 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.com | e4ee35d | 2012-08-14 13:22:16 +0000 | [diff] [blame] | 39 | #undef NAME_WRAP |