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 20 matching lines...) Expand all Loading... |
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 // Swizzle input into some sort of 8888 pixel, {premul,unpremul} x {rgba,bgr
a}. | 58 // Swizzle input into some sort of 8888 pixel, {premul,unpremul} x {rgba,bgr
a}. |
62 typedef void (*Swizzle_8888)(uint32_t*, const void*, int); | 59 typedef void (*Swizzle_8888)(uint32_t*, const void*, int); |
63 extern Swizzle_8888 RGBA_to_BGRA, // i.e. just swap RB | 60 extern Swizzle_8888 RGBA_to_BGRA, // i.e. just swap RB |
64 RGBA_to_rgbA, // i.e. just premultiply | 61 RGBA_to_rgbA, // i.e. just premultiply |
65 RGBA_to_bgrA; // i.e. swap RB and premultiply | 62 RGBA_to_bgrA; // i.e. swap RB and premultiply |
66 } | 63 } |
67 | 64 |
68 #endif//SkOpts_DEFINED | 65 #endif//SkOpts_DEFINED |
OLD | NEW |