| OLD | NEW |
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 4 * | 3 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 8 | 7 |
| 9 // Define NAME_WRAP(x) before including this header to perform name-wrapping | 8 // Define NAME_WRAP(x) before including this header to perform name-wrapping |
| 10 // E.g. for ARM NEON, defined it as 'x ## _neon' to ensure all important | 9 // E.g. for ARM NEON, defined it as 'x ## _neon' to ensure all important |
| 11 // identifiers have a _neon suffix. | 10 // identifiers have a _neon suffix. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 * | 80 * |
| 82 * D32 functions | 81 * D32 functions |
| 83 * | 82 * |
| 84 */ | 83 */ |
| 85 | 84 |
| 86 // SRC == 8888 | 85 // SRC == 8888 |
| 87 | 86 |
| 88 #define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_opaque)(x, y, a
, b, c, d, dst) | 87 #define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_opaque)(x, y, a
, b, c, d, dst) |
| 89 | 88 |
| 90 #define MAKENAME(suffix) NAME_WRAP(S32_opaque_D32 ## suffix) | 89 #define MAKENAME(suffix) NAME_WRAP(S32_opaque_D32 ## suffix) |
| 91 #define DSTSIZE 32 | |
| 92 #define SRCTYPE SkPMColor | 90 #define SRCTYPE SkPMColor |
| 93 #define CHECKSTATE(state) SkASSERT(4 == state.fPixmap.info().bytesPerPixel
()); \ | 91 #define CHECKSTATE(state) SkASSERT(4 == state.fPixmap.info().bytesPerPixel
()); \ |
| 94 SkASSERT(state.fAlphaScale == 256) | 92 SkASSERT(state.fAlphaScale == 256) |
| 95 #define RETURNDST(src) src | 93 #define RETURNDST(src) src |
| 96 #define SRC_TO_FILTER(src) src | 94 #define SRC_TO_FILTER(src) src |
| 97 #include "SkBitmapProcState_sample.h" | 95 #include "SkBitmapProcState_sample.h" |
| 98 | 96 |
| 99 #undef FILTER_PROC | 97 #undef FILTER_PROC |
| 100 #define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_alpha)(x, y, a,
b, c, d, dst, alphaScale) | 98 #define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_alpha)(x, y, a,
b, c, d, dst, alphaScale) |
| 101 | 99 |
| 102 #define MAKENAME(suffix) NAME_WRAP(S32_alpha_D32 ## suffix) | 100 #define MAKENAME(suffix) NAME_WRAP(S32_alpha_D32 ## suffix) |
| 103 #define DSTSIZE 32 | |
| 104 #define SRCTYPE SkPMColor | 101 #define SRCTYPE SkPMColor |
| 105 #define CHECKSTATE(state) SkASSERT(4 == state.fPixmap.info().bytesPerPixel
()); \ | 102 #define CHECKSTATE(state) SkASSERT(4 == state.fPixmap.info().bytesPerPixel
()); \ |
| 106 SkASSERT(state.fAlphaScale < 256) | 103 SkASSERT(state.fAlphaScale < 256) |
| 107 #define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale | 104 #define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale |
| 108 #define RETURNDST(src) SkAlphaMulQ(src, alphaScale) | 105 #define RETURNDST(src) SkAlphaMulQ(src, alphaScale) |
| 109 #define SRC_TO_FILTER(src) src | 106 #define SRC_TO_FILTER(src) src |
| 110 #include "SkBitmapProcState_sample.h" | 107 #include "SkBitmapProcState_sample.h" |
| 111 | 108 |
| 112 // SRC == 565 | 109 // SRC == 565 |
| 113 | 110 |
| 114 #undef FILTER_PROC | 111 #undef FILTER_PROC |
| 115 #define FILTER_PROC(x, y, a, b, c, d, dst) \ | 112 #define FILTER_PROC(x, y, a, b, c, d, dst) \ |
| 116 do { \ | 113 do { \ |
| 117 uint32_t tmp = Filter_565_Expanded(x, y, a, b, c, d); \ | 114 uint32_t tmp = Filter_565_Expanded(x, y, a, b, c, d); \ |
| 118 *(dst) = SkExpanded_565_To_PMColor(tmp); \ | 115 *(dst) = SkExpanded_565_To_PMColor(tmp); \ |
| 119 } while (0) | 116 } while (0) |
| 120 | 117 |
| 121 #define MAKENAME(suffix) NAME_WRAP(S16_opaque_D32 ## suffix) | 118 #define MAKENAME(suffix) NAME_WRAP(S16_opaque_D32 ## suffix) |
| 122 #define DSTSIZE 32 | |
| 123 #define SRCTYPE uint16_t | 119 #define SRCTYPE uint16_t |
| 124 #define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fPixmap.c
olorType()); \ | 120 #define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fPixmap.c
olorType()); \ |
| 125 SkASSERT(state.fAlphaScale == 256) | 121 SkASSERT(state.fAlphaScale == 256) |
| 126 #define RETURNDST(src) SkPixel16ToPixel32(src) | 122 #define RETURNDST(src) SkPixel16ToPixel32(src) |
| 127 #define SRC_TO_FILTER(src) src | 123 #define SRC_TO_FILTER(src) src |
| 128 #include "SkBitmapProcState_sample.h" | 124 #include "SkBitmapProcState_sample.h" |
| 129 | 125 |
| 130 #undef FILTER_PROC | 126 #undef FILTER_PROC |
| 131 #define FILTER_PROC(x, y, a, b, c, d, dst) \ | 127 #define FILTER_PROC(x, y, a, b, c, d, dst) \ |
| 132 do { \ | 128 do { \ |
| 133 uint32_t tmp = Filter_565_Expanded(x, y, a, b, c, d); \ | 129 uint32_t tmp = Filter_565_Expanded(x, y, a, b, c, d); \ |
| 134 *(dst) = SkAlphaMulQ(SkExpanded_565_To_PMColor(tmp), alphaScale); \ | 130 *(dst) = SkAlphaMulQ(SkExpanded_565_To_PMColor(tmp), alphaScale); \ |
| 135 } while (0) | 131 } while (0) |
| 136 | 132 |
| 137 #define MAKENAME(suffix) NAME_WRAP(S16_alpha_D32 ## suffix) | 133 #define MAKENAME(suffix) NAME_WRAP(S16_alpha_D32 ## suffix) |
| 138 #define DSTSIZE 32 | |
| 139 #define SRCTYPE uint16_t | 134 #define SRCTYPE uint16_t |
| 140 #define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fPixmap.c
olorType()); \ | 135 #define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fPixmap.c
olorType()); \ |
| 141 SkASSERT(state.fAlphaScale < 256) | 136 SkASSERT(state.fAlphaScale < 256) |
| 142 #define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale | 137 #define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale |
| 143 #define RETURNDST(src) SkAlphaMulQ(SkPixel16ToPixel32(src), alphaScale) | 138 #define RETURNDST(src) SkAlphaMulQ(SkPixel16ToPixel32(src), alphaScale) |
| 144 #define SRC_TO_FILTER(src) src | 139 #define SRC_TO_FILTER(src) src |
| 145 #include "SkBitmapProcState_sample.h" | 140 #include "SkBitmapProcState_sample.h" |
| 146 | 141 |
| 147 // SRC == Index8 | 142 // SRC == Index8 |
| 148 | 143 |
| 149 #undef FILTER_PROC | 144 #undef FILTER_PROC |
| 150 #define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_opaque)(x, y, a
, b, c, d, dst) | 145 #define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_opaque)(x, y, a
, b, c, d, dst) |
| 151 | 146 |
| 152 #define MAKENAME(suffix) NAME_WRAP(SI8_opaque_D32 ## suffix) | 147 #define MAKENAME(suffix) NAME_WRAP(SI8_opaque_D32 ## suffix) |
| 153 #define DSTSIZE 32 | |
| 154 #define SRCTYPE uint8_t | 148 #define SRCTYPE uint8_t |
| 155 #define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fPixmap.c
olorType()); \ | 149 #define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fPixmap.c
olorType()); \ |
| 156 SkASSERT(state.fAlphaScale == 256) | 150 SkASSERT(state.fAlphaScale == 256) |
| 157 #define PREAMBLE(state) const SkPMColor* SK_RESTRICT table = state.fPixm
ap.ctable()->readColors() | 151 #define PREAMBLE(state) const SkPMColor* SK_RESTRICT table = state.fPixm
ap.ctable()->readColors() |
| 158 #define RETURNDST(src) table[src] | 152 #define RETURNDST(src) table[src] |
| 159 #define SRC_TO_FILTER(src) table[src] | 153 #define SRC_TO_FILTER(src) table[src] |
| 160 #define POSTAMBLE(state) | 154 #define POSTAMBLE(state) |
| 161 #include "SkBitmapProcState_sample.h" | 155 #include "SkBitmapProcState_sample.h" |
| 162 | 156 |
| 163 #undef FILTER_PROC | 157 #undef FILTER_PROC |
| 164 #define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_alpha)(x, y, a,
b, c, d, dst, alphaScale) | 158 #define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_alpha)(x, y, a,
b, c, d, dst, alphaScale) |
| 165 | 159 |
| 166 #define MAKENAME(suffix) NAME_WRAP(SI8_alpha_D32 ## suffix) | 160 #define MAKENAME(suffix) NAME_WRAP(SI8_alpha_D32 ## suffix) |
| 167 #define DSTSIZE 32 | |
| 168 #define SRCTYPE uint8_t | 161 #define SRCTYPE uint8_t |
| 169 #define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fPixmap.c
olorType()); \ | 162 #define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fPixmap.c
olorType()); \ |
| 170 SkASSERT(state.fAlphaScale < 256) | 163 SkASSERT(state.fAlphaScale < 256) |
| 171 #define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale; \ | 164 #define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale; \ |
| 172 const SkPMColor* SK_RESTRICT table = state.fPixm
ap.ctable()->readColors() | 165 const SkPMColor* SK_RESTRICT table = state.fPixm
ap.ctable()->readColors() |
| 173 #define RETURNDST(src) SkAlphaMulQ(table[src], alphaScale) | 166 #define RETURNDST(src) SkAlphaMulQ(table[src], alphaScale) |
| 174 #define SRC_TO_FILTER(src) table[src] | 167 #define SRC_TO_FILTER(src) table[src] |
| 175 #define POSTAMBLE(state) | 168 #define POSTAMBLE(state) |
| 176 #include "SkBitmapProcState_sample.h" | 169 #include "SkBitmapProcState_sample.h" |
| 177 | 170 |
| 178 // SRC == 4444 | 171 // SRC == 4444 |
| 179 | 172 |
| 180 #undef FILTER_PROC | 173 #undef FILTER_PROC |
| 181 #define FILTER_PROC(x, y, a, b, c, d, dst) *(dst) = Filter_4444_D32(x, y, a, b,
c, d) | 174 #define FILTER_PROC(x, y, a, b, c, d, dst) *(dst) = Filter_4444_D32(x, y, a, b,
c, d) |
| 182 | 175 |
| 183 #define MAKENAME(suffix) NAME_WRAP(S4444_opaque_D32 ## suffix) | 176 #define MAKENAME(suffix) NAME_WRAP(S4444_opaque_D32 ## suffix) |
| 184 #define DSTSIZE 32 | |
| 185 #define SRCTYPE SkPMColor16 | 177 #define SRCTYPE SkPMColor16 |
| 186 #define CHECKSTATE(state) SkASSERT(kARGB_4444_SkColorType == state.fPixmap
.colorType()); \ | 178 #define CHECKSTATE(state) SkASSERT(kARGB_4444_SkColorType == state.fPixmap
.colorType()); \ |
| 187 SkASSERT(state.fAlphaScale == 256) | 179 SkASSERT(state.fAlphaScale == 256) |
| 188 #define RETURNDST(src) SkPixel4444ToPixel32(src) | 180 #define RETURNDST(src) SkPixel4444ToPixel32(src) |
| 189 #define SRC_TO_FILTER(src) src | 181 #define SRC_TO_FILTER(src) src |
| 190 #include "SkBitmapProcState_sample.h" | 182 #include "SkBitmapProcState_sample.h" |
| 191 | 183 |
| 192 #undef FILTER_PROC | 184 #undef FILTER_PROC |
| 193 #define FILTER_PROC(x, y, a, b, c, d, dst) \ | 185 #define FILTER_PROC(x, y, a, b, c, d, dst) \ |
| 194 do { \ | 186 do { \ |
| 195 uint32_t tmp = Filter_4444_D32(x, y, a, b, c, d); \ | 187 uint32_t tmp = Filter_4444_D32(x, y, a, b, c, d); \ |
| 196 *(dst) = SkAlphaMulQ(tmp, alphaScale); \ | 188 *(dst) = SkAlphaMulQ(tmp, alphaScale); \ |
| 197 } while (0) | 189 } while (0) |
| 198 | 190 |
| 199 #define MAKENAME(suffix) NAME_WRAP(S4444_alpha_D32 ## suffix) | 191 #define MAKENAME(suffix) NAME_WRAP(S4444_alpha_D32 ## suffix) |
| 200 #define DSTSIZE 32 | |
| 201 #define SRCTYPE SkPMColor16 | 192 #define SRCTYPE SkPMColor16 |
| 202 #define CHECKSTATE(state) SkASSERT(kARGB_4444_SkColorType == state.fPixmap
.colorType()); \ | 193 #define CHECKSTATE(state) SkASSERT(kARGB_4444_SkColorType == state.fPixmap
.colorType()); \ |
| 203 SkASSERT(state.fAlphaScale < 256) | 194 SkASSERT(state.fAlphaScale < 256) |
| 204 #define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale | 195 #define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale |
| 205 #define RETURNDST(src) SkAlphaMulQ(SkPixel4444ToPixel32(src), alphaScal
e) | 196 #define RETURNDST(src) SkAlphaMulQ(SkPixel4444ToPixel32(src), alphaScal
e) |
| 206 #define SRC_TO_FILTER(src) src | 197 #define SRC_TO_FILTER(src) src |
| 207 #include "SkBitmapProcState_sample.h" | 198 #include "SkBitmapProcState_sample.h" |
| 208 | 199 |
| 209 // SRC == A8 | 200 // SRC == A8 |
| 210 | 201 |
| 211 #undef FILTER_PROC | 202 #undef FILTER_PROC |
| 212 #define FILTER_PROC(x, y, a, b, c, d, dst) \ | 203 #define FILTER_PROC(x, y, a, b, c, d, dst) \ |
| 213 do { \ | 204 do { \ |
| 214 unsigned tmp = Filter_8(x, y, a, b, c, d); \ | 205 unsigned tmp = Filter_8(x, y, a, b, c, d); \ |
| 215 *(dst) = SkAlphaMulQ(pmColor, SkAlpha255To256(tmp)); \ | 206 *(dst) = SkAlphaMulQ(pmColor, SkAlpha255To256(tmp)); \ |
| 216 } while (0) | 207 } while (0) |
| 217 | 208 |
| 218 #define MAKENAME(suffix) NAME_WRAP(SA8_alpha_D32 ## suffix) | 209 #define MAKENAME(suffix) NAME_WRAP(SA8_alpha_D32 ## suffix) |
| 219 #define DSTSIZE 32 | |
| 220 #define SRCTYPE uint8_t | 210 #define SRCTYPE uint8_t |
| 221 #define CHECKSTATE(state) SkASSERT(kAlpha_8_SkColorType == state.fPixmap.c
olorType()); | 211 #define CHECKSTATE(state) SkASSERT(kAlpha_8_SkColorType == state.fPixmap.c
olorType()); |
| 222 #define PREAMBLE(state) const SkPMColor pmColor = state.fPaintPMColor; | 212 #define PREAMBLE(state) const SkPMColor pmColor = state.fPaintPMColor; |
| 223 #define RETURNDST(src) SkAlphaMulQ(pmColor, SkAlpha255To256(src)) | 213 #define RETURNDST(src) SkAlphaMulQ(pmColor, SkAlpha255To256(src)) |
| 224 #define SRC_TO_FILTER(src) src | 214 #define SRC_TO_FILTER(src) src |
| 225 #include "SkBitmapProcState_sample.h" | 215 #include "SkBitmapProcState_sample.h" |
| 226 | 216 |
| 227 // SRC == Gray8 | 217 // SRC == Gray8 |
| 228 | 218 |
| 229 #undef FILTER_PROC | 219 #undef FILTER_PROC |
| 230 #define FILTER_PROC(x, y, a, b, c, d, dst) \ | 220 #define FILTER_PROC(x, y, a, b, c, d, dst) \ |
| 231 do { \ | 221 do { \ |
| 232 unsigned tmp = Filter_8(x, y, a, b, c, d); \ | 222 unsigned tmp = Filter_8(x, y, a, b, c, d); \ |
| 233 SkPMColor color = SkPackARGB32(0xFF, tmp, tmp, tmp); \ | 223 SkPMColor color = SkPackARGB32(0xFF, tmp, tmp, tmp); \ |
| 234 *(dst) = SkAlphaMulQ(color, alphaScale); \ | 224 *(dst) = SkAlphaMulQ(color, alphaScale); \ |
| 235 } while (0) | 225 } while (0) |
| 236 | 226 |
| 237 #define MAKENAME(suffix) NAME_WRAP(SG8_alpha_D32 ## suffix) | 227 #define MAKENAME(suffix) NAME_WRAP(SG8_alpha_D32 ## suffix) |
| 238 #define DSTSIZE 32 | |
| 239 #define SRCTYPE uint8_t | 228 #define SRCTYPE uint8_t |
| 240 #define CHECKSTATE(state) SkASSERT(kGray_8_SkColorType == state.fPixmap.co
lorType()); | 229 #define CHECKSTATE(state) SkASSERT(kGray_8_SkColorType == state.fPixmap.co
lorType()); |
| 241 #define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale | 230 #define PREAMBLE(state) unsigned alphaScale = state.fAlphaScale |
| 242 #define RETURNDST(src) SkAlphaMulQ(SkPackARGB32(0xFF, src, src, src), a
lphaScale) | 231 #define RETURNDST(src) SkAlphaMulQ(SkPackARGB32(0xFF, src, src, src), a
lphaScale) |
| 243 #define SRC_TO_FILTER(src) src | 232 #define SRC_TO_FILTER(src) src |
| 244 #include "SkBitmapProcState_sample.h" | 233 #include "SkBitmapProcState_sample.h" |
| 245 | 234 |
| 246 /***************************************************************************** | |
| 247 * | |
| 248 * D16 functions | |
| 249 * | |
| 250 */ | |
| 251 | |
| 252 // SRC == 8888 | |
| 253 | |
| 254 #undef FILTER_PROC | |
| 255 #define FILTER_PROC(x, y, a, b, c, d, dst) \ | |
| 256 do { \ | |
| 257 SkPMColor dstColor; \ | |
| 258 NAME_WRAP(Filter_32_opaque)(x, y, a, b, c, d, &dstColor); \ | |
| 259 (*dst) = SkPixel32ToPixel16(dstColor); \ | |
| 260 } while (0) | |
| 261 | |
| 262 #define MAKENAME(suffix) NAME_WRAP(S32_D16 ## suffix) | |
| 263 #define DSTSIZE 16 | |
| 264 #define SRCTYPE SkPMColor | |
| 265 #define CHECKSTATE(state) SkASSERT(4 == state.fPixmap.info().bytesPerPixel
()); \ | |
| 266 SkASSERT(state.fPixmap.isOpaque()) | |
| 267 #define RETURNDST(src) SkPixel32ToPixel16(src) | |
| 268 #define SRC_TO_FILTER(src) src | |
| 269 #include "SkBitmapProcState_sample.h" | |
| 270 | |
| 271 // SRC == 565 | |
| 272 | |
| 273 #undef FILTER_PROC | |
| 274 #define FILTER_PROC(x, y, a, b, c, d, dst) \ | |
| 275 do { \ | |
| 276 uint32_t tmp = Filter_565_Expanded(x, y, a, b, c, d); \ | |
| 277 *(dst) = SkCompact_rgb_16((tmp) >> 5); \ | |
| 278 } while (0) | |
| 279 | |
| 280 #define MAKENAME(suffix) NAME_WRAP(S16_D16 ## suffix) | |
| 281 #define DSTSIZE 16 | |
| 282 #define SRCTYPE uint16_t | |
| 283 #define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fPixmap.c
olorType()) | |
| 284 #define RETURNDST(src) src | |
| 285 #define SRC_TO_FILTER(src) src | |
| 286 #include "SkBitmapProcState_sample.h" | |
| 287 | |
| 288 // SRC == Index8 | |
| 289 | |
| 290 #undef FILTER_PROC | |
| 291 #define FILTER_PROC(x, y, a, b, c, d, dst) \ | |
| 292 do { \ | |
| 293 uint32_t tmp = Filter_565_Expanded(x, y, a, b, c, d); \ | |
| 294 *(dst) = SkCompact_rgb_16((tmp) >> 5); \ | |
| 295 } while (0) | |
| 296 | |
| 297 #define MAKENAME(suffix) NAME_WRAP(SI8_D16 ## suffix) | |
| 298 #define DSTSIZE 16 | |
| 299 #define SRCTYPE uint8_t | |
| 300 #define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fPixmap.c
olorType()); \ | |
| 301 SkASSERT(state.fPixmap.isOpaque()) | |
| 302 #define PREAMBLE(state) const uint16_t* SK_RESTRICT table = state.fPixma
p.ctable()->read16BitCache() | |
| 303 #define RETURNDST(src) table[src] | |
| 304 #define SRC_TO_FILTER(src) table[src] | |
| 305 #define POSTAMBLE(state) | |
| 306 #include "SkBitmapProcState_sample.h" | |
| 307 | |
| 308 /////////////////////////////////////////////////////////////////////////////// | |
| 309 | |
| 310 #undef FILTER_PROC | |
| 311 #define FILTER_PROC(x, y, a, b, c, d, dst) \ | |
| 312 do { \ | |
| 313 uint32_t tmp = Filter_565_Expanded(x, y, a, b, c, d); \ | |
| 314 *(dst) = SkCompact_rgb_16((tmp) >> 5); \ | |
| 315 } while (0) | |
| 316 | |
| 317 | |
| 318 // clamp | |
| 319 | |
| 320 #define TILEX_PROCF(fx, max) SkClampMax((fx) >> 16, max) | |
| 321 #define TILEY_PROCF(fy, max) SkClampMax((fy) >> 16, max) | |
| 322 #define TILEX_LOW_BITS(fx, max) (((fx) >> 12) & 0xF) | |
| 323 #define TILEY_LOW_BITS(fy, max) (((fy) >> 12) & 0xF) | |
| 324 | |
| 325 #define MAKENAME(suffix) NAME_WRAP(Clamp_S16_D16 ## suffix) | |
| 326 #define SRCTYPE uint16_t | |
| 327 #define DSTTYPE uint16_t | |
| 328 #define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fPixmap.c
olorType()) | |
| 329 #define SRC_TO_FILTER(src) src | |
| 330 #include "SkBitmapProcState_shaderproc.h" | |
| 331 | |
| 332 | |
| 333 #define TILEX_PROCF(fx, max) (((fx) & 0xFFFF) * ((max) + 1) >> 16) | |
| 334 #define TILEY_PROCF(fy, max) (((fy) & 0xFFFF) * ((max) + 1) >> 16) | |
| 335 #define TILEX_LOW_BITS(fx, max) ((((fx) & 0xFFFF) * ((max) + 1) >> 12) & 0xF) | |
| 336 #define TILEY_LOW_BITS(fy, max) ((((fy) & 0xFFFF) * ((max) + 1) >> 12) & 0xF) | |
| 337 | |
| 338 #define MAKENAME(suffix) NAME_WRAP(Repeat_S16_D16 ## suffix) | |
| 339 #define SRCTYPE uint16_t | |
| 340 #define DSTTYPE uint16_t | |
| 341 #define CHECKSTATE(state) SkASSERT(kRGB_565_SkColorType == state.fPixmap.c
olorType()) | |
| 342 #define SRC_TO_FILTER(src) src | |
| 343 #include "SkBitmapProcState_shaderproc.h" | |
| 344 | |
| 345 | 235 |
| 346 #define TILEX_PROCF(fx, max) SkClampMax((fx) >> 16, max) | 236 #define TILEX_PROCF(fx, max) SkClampMax((fx) >> 16, max) |
| 347 #define TILEY_PROCF(fy, max) SkClampMax((fy) >> 16, max) | 237 #define TILEY_PROCF(fy, max) SkClampMax((fy) >> 16, max) |
| 348 #define TILEX_LOW_BITS(fx, max) (((fx) >> 12) & 0xF) | 238 #define TILEX_LOW_BITS(fx, max) (((fx) >> 12) & 0xF) |
| 349 #define TILEY_LOW_BITS(fy, max) (((fy) >> 12) & 0xF) | 239 #define TILEY_LOW_BITS(fy, max) (((fy) >> 12) & 0xF) |
| 350 | 240 |
| 351 #undef FILTER_PROC | 241 #undef FILTER_PROC |
| 352 #define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_opaque)(x, y, a
, b, c, d, dst) | 242 #define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_opaque)(x, y, a
, b, c, d, dst) |
| 353 #define MAKENAME(suffix) NAME_WRAP(Clamp_SI8_opaque_D32 ## suffix) | 243 #define MAKENAME(suffix) NAME_WRAP(Clamp_SI8_opaque_D32 ## suffix) |
| 354 #define SRCTYPE uint8_t | 244 #define SRCTYPE uint8_t |
| 355 #define DSTTYPE uint32_t | |
| 356 #define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fPixmap.c
olorType()) | 245 #define CHECKSTATE(state) SkASSERT(kIndex_8_SkColorType == state.fPixmap.c
olorType()) |
| 357 #define PREAMBLE(state) const SkPMColor* SK_RESTRICT table = state.fPixm
ap.ctable()->readColors() | 246 #define PREAMBLE(state) const SkPMColor* SK_RESTRICT table = state.fPixm
ap.ctable()->readColors() |
| 358 #define SRC_TO_FILTER(src) table[src] | 247 #define SRC_TO_FILTER(src) table[src] |
| 359 #define POSTAMBLE(state) | 248 #define POSTAMBLE(state) |
| 360 #include "SkBitmapProcState_shaderproc.h" | 249 #include "SkBitmapProcState_shaderproc.h" |
| 361 | 250 |
| 362 #undef NAME_WRAP | 251 #undef NAME_WRAP |
| OLD | NEW |