diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkOpts.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/core/SkOpts.h b/src/core/SkOpts.h new file mode 100644 index 0000000000..9239f8efec --- /dev/null +++ b/src/core/SkOpts.h @@ -0,0 +1,35 @@ +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SkOpts_DEFINED +#define SkOpts_DEFINED + +#include "SkTypes.h" +#include "SkXfermode.h" + +struct ProcCoeff; + +namespace SkOpts { + // Call to replace pointers to portable functions with pointers to CPU-specific functions. + // Thread-safe and idempotent. + // Called by SkGraphics::Init(), and automatically #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS. + void Init(); + + // Declare function pointers here... + + // Returns a fast approximation of 1.0f/sqrtf(x). + extern float (*rsqrt)(float); + + // See SkUtils.h + extern void (*memset16)(uint16_t[], uint16_t, int); + extern void (*memset32)(uint32_t[], uint32_t, int); + + // May return nullptr if we haven't specialized the given Mode. + extern SkXfermode* (*create_xfermode)(const ProcCoeff&, SkXfermode::Mode); +} + +#endif//SkOpts_DEFINED |