| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * 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 |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkOpts_DEFINED | 8 #ifndef SkOpts_DEFINED |
| 9 #define SkOpts_DEFINED | 9 #define SkOpts_DEFINED |
| 10 | 10 |
| 11 #include "SkMatrix.h" | 11 #include "SkMatrix.h" |
| 12 #include "SkTextureCompressor.h" | 12 #include "SkTextureCompressor.h" |
| 13 #include "SkTypes.h" | 13 #include "SkTypes.h" |
| 14 #include "SkXfermode.h" | 14 #include "SkXfermode.h" |
| 15 | 15 |
| 16 struct ProcCoeff; | 16 struct ProcCoeff; |
| 17 | 17 |
| 18 namespace SkOpts { | 18 namespace SkOpts { |
| 19 // Call to replace pointers to portable functions with pointers to CPU-speci
fic functions. | 19 // Call to replace pointers to portable functions with pointers to CPU-speci
fic functions. |
| 20 // Thread-safe and idempotent. | 20 // Thread-safe and idempotent. |
| 21 // Called by SkGraphics::Init(), and automatically #if SK_ALLOW_STATIC_GLOBA
L_INITIALIZERS. | 21 // Called by SkGraphics::Init(), and automatically #if SK_ALLOW_STATIC_GLOBA
L_INITIALIZERS. |
| 22 void Init(); | 22 void Init(); |
| 23 | 23 |
| 24 // Declare function pointers here... | 24 // Declare function pointers here... |
| 25 | 25 |
| 26 // Returns a fast approximation of 1.0f/sqrtf(x). | |
| 27 extern float (*rsqrt)(float); | |
| 28 | |
| 29 // See SkUtils.h | 26 // See SkUtils.h |
| 30 extern void (*memset16)(uint16_t[], uint16_t, int); | 27 extern void (*memset16)(uint16_t[], uint16_t, int); |
| 31 extern void (*memset32)(uint32_t[], uint32_t, int); | 28 extern void (*memset32)(uint32_t[], uint32_t, int); |
| 32 | 29 |
| 33 // May return nullptr if we haven't specialized the given Mode. | 30 // May return nullptr if we haven't specialized the given Mode. |
| 34 extern SkXfermode* (*create_xfermode)(const ProcCoeff&, SkXfermode::Mode); | 31 extern SkXfermode* (*create_xfermode)(const ProcCoeff&, SkXfermode::Mode); |
| 35 | 32 |
| 36 typedef void (*BoxBlur)(const SkPMColor*, int, const SkIRect& srcBounds, SkP
MColor*, int, int, int, int, int); | 33 typedef void (*BoxBlur)(const SkPMColor*, int, const SkIRect& srcBounds, SkP
MColor*, int, int, int, int, int); |
| 37 extern BoxBlur box_blur_xx, box_blur_xy, box_blur_yx; | 34 extern BoxBlur box_blur_xx, box_blur_xy, box_blur_yx; |
| 38 | 35 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 58 | 55 |
| 59 extern SkMatrix::MapPtsProc matrix_translate, matrix_scale_translate, matrix
_affine; | 56 extern SkMatrix::MapPtsProc matrix_translate, matrix_scale_translate, matrix
_affine; |
| 60 | 57 |
| 61 typedef void (*Swizzle_8888_8888)(uint32_t[], const uint32_t[], int); | 58 typedef void (*Swizzle_8888_8888)(uint32_t[], const uint32_t[], int); |
| 62 extern Swizzle_8888_8888 premul_xxxa, // BGRA -> bgrA or RGBA -> rgbA | 59 extern Swizzle_8888_8888 premul_xxxa, // BGRA -> bgrA or RGBA -> rgbA |
| 63 swaprb_xxxa, // BGRA -> RGBA or RGBA -> BGRA | 60 swaprb_xxxa, // BGRA -> RGBA or RGBA -> BGRA |
| 64 premul_swaprb_xxxa; // BGRA -> rgbA or RGBA -> bgrA | 61 premul_swaprb_xxxa; // BGRA -> rgbA or RGBA -> bgrA |
| 65 } | 62 } |
| 66 | 63 |
| 67 #endif//SkOpts_DEFINED | 64 #endif//SkOpts_DEFINED |
| OLD | NEW |