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 "SkTextureCompressor.h" |
11 #include "SkTypes.h" | 12 #include "SkTypes.h" |
12 #include "SkXfermode.h" | 13 #include "SkXfermode.h" |
13 | 14 |
14 struct ProcCoeff; | 15 struct ProcCoeff; |
15 | 16 |
16 namespace SkOpts { | 17 namespace SkOpts { |
17 // Call to replace pointers to portable functions with pointers to CPU-speci
fic functions. | 18 // Call to replace pointers to portable functions with pointers to CPU-speci
fic functions. |
18 // Thread-safe and idempotent. | 19 // Thread-safe and idempotent. |
19 // Called by SkGraphics::Init(), and automatically #if SK_ALLOW_STATIC_GLOBA
L_INITIALIZERS. | 20 // Called by SkGraphics::Init(), and automatically #if SK_ALLOW_STATIC_GLOBA
L_INITIALIZERS. |
20 void Init(); | 21 void Init(); |
21 | 22 |
22 // Declare function pointers here... | 23 // Declare function pointers here... |
23 | 24 |
24 // Returns a fast approximation of 1.0f/sqrtf(x). | 25 // Returns a fast approximation of 1.0f/sqrtf(x). |
25 extern float (*rsqrt)(float); | 26 extern float (*rsqrt)(float); |
26 | 27 |
27 // See SkUtils.h | 28 // See SkUtils.h |
28 extern void (*memset16)(uint16_t[], uint16_t, int); | 29 extern void (*memset16)(uint16_t[], uint16_t, int); |
29 extern void (*memset32)(uint32_t[], uint32_t, int); | 30 extern void (*memset32)(uint32_t[], uint32_t, int); |
30 | 31 |
31 // May return nullptr if we haven't specialized the given Mode. | 32 // May return nullptr if we haven't specialized the given Mode. |
32 extern SkXfermode* (*create_xfermode)(const ProcCoeff&, SkXfermode::Mode); | 33 extern SkXfermode* (*create_xfermode)(const ProcCoeff&, SkXfermode::Mode); |
33 | 34 |
34 typedef void (*BoxBlur)(const SkPMColor*, int, SkPMColor*, int, int, int, in
t, int); | 35 typedef void (*BoxBlur)(const SkPMColor*, int, SkPMColor*, int, int, int, in
t, int); |
35 extern BoxBlur box_blur_xx, box_blur_xy, box_blur_yx; | 36 extern BoxBlur box_blur_xx, box_blur_xy, box_blur_yx; |
36 | 37 |
37 typedef void (*Morph)(const SkPMColor*, SkPMColor*, int, int, int, int, int)
; | 38 typedef void (*Morph)(const SkPMColor*, SkPMColor*, int, int, int, int, int)
; |
38 extern Morph dilate_x, dilate_y, erode_x, erode_y; | 39 extern Morph dilate_x, dilate_y, erode_x, erode_y; |
| 40 |
| 41 typedef bool (*TextureCompressor)(uint8_t* dst, const uint8_t* src, |
| 42 int width, int height, size_t rowBytes); |
| 43 extern TextureCompressor (*texture_compressor)(SkColorType, SkTextureCompres
sor::Format); |
| 44 extern bool (*fill_block_dimensions)(SkTextureCompressor::Format, int* x, in
t* y); |
| 45 |
39 } | 46 } |
40 | 47 |
41 #endif//SkOpts_DEFINED | 48 #endif//SkOpts_DEFINED |
OLD | NEW |