skia2/include/private/SkOpts.h
mtklein 490b61569d Port SkXfermode opts to SkOpts.h
Renames Sk4pxXfermode.h to SkXfermode_opts.h,
and refactors it a tiny bit internally.

This moves xfermode optimization from being "compile-time everywhere but NEON"
to simply "runtime everywhere".  I don't anticipate any effect on perf or
correctness.

BUG=skia:4117

Review URL: https://codereview.chromium.org/1264543006
2015-07-31 11:50:27 -07:00

36 lines
958 B
C++

/*
* 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