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 |
26 // See SkUtils.h | 29 // See SkUtils.h |
27 extern void (*memset16)(uint16_t[], uint16_t, int); | 30 extern void (*memset16)(uint16_t[], uint16_t, int); |
28 extern void (*memset32)(uint32_t[], uint32_t, int); | 31 extern void (*memset32)(uint32_t[], uint32_t, int); |
29 | 32 |
30 // May return nullptr if we haven't specialized the given Mode. | 33 // May return nullptr if we haven't specialized the given Mode. |
31 extern SkXfermode* (*create_xfermode)(const ProcCoeff&, SkXfermode::Mode); | 34 extern SkXfermode* (*create_xfermode)(const ProcCoeff&, SkXfermode::Mode); |
32 | 35 |
33 typedef void (*BoxBlur)(const SkPMColor*, int, const SkIRect& srcBounds, SkP
MColor*, int, int, int, int, int); | 36 typedef void (*BoxBlur)(const SkPMColor*, int, const SkIRect& srcBounds, SkP
MColor*, int, int, int, int, int); |
34 extern BoxBlur box_blur_xx, box_blur_xy, box_blur_yx; | 37 extern BoxBlur box_blur_xx, box_blur_xy, box_blur_yx; |
35 | 38 |
(...skipping 20 matching lines...) Expand all Loading... |
56 extern SkMatrix::MapPtsProc matrix_translate, matrix_scale_translate, matrix
_affine; | 59 extern SkMatrix::MapPtsProc matrix_translate, matrix_scale_translate, matrix
_affine; |
57 | 60 |
58 // Swizzle input into some sort of 8888 pixel, {premul,unpremul} x {rgba,bgr
a}. | 61 // Swizzle input into some sort of 8888 pixel, {premul,unpremul} x {rgba,bgr
a}. |
59 typedef void (*Swizzle_8888)(uint32_t*, const void*, int); | 62 typedef void (*Swizzle_8888)(uint32_t*, const void*, int); |
60 extern Swizzle_8888 RGBA_to_BGRA, // i.e. just swap RB | 63 extern Swizzle_8888 RGBA_to_BGRA, // i.e. just swap RB |
61 RGBA_to_rgbA, // i.e. just premultiply | 64 RGBA_to_rgbA, // i.e. just premultiply |
62 RGBA_to_bgrA; // i.e. swap RB and premultiply | 65 RGBA_to_bgrA; // i.e. swap RB and premultiply |
63 } | 66 } |
64 | 67 |
65 #endif//SkOpts_DEFINED | 68 #endif//SkOpts_DEFINED |
OLD | NEW |