aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkOpts.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-07-30 09:29:37 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-30 09:29:37 -0700
commitf684a78d9ea988883c9b2c7bcc4ea4d5e68bd998 (patch)
treebe6bdcaa7d6a16c09f61ba94dd7e03739f78673c /src/core/SkOpts.h
parent4f19ca325e8d0122e0a04345272d17e674460806 (diff)
Runtime CPU detection for rsqrt().
This enables the NEON sk_float_rsqrt() code for configurations that have NEON at run-time but not compile-time. These devices will see about a 2x (1.26 -> 2.33) slowdown in sk_float_rsqrt(), but it should be more precise than our portable fallback. (When inlined, the portable fallback and the NEON code are almost identical in speed. The only difference is precision. Going through a function pointer is causing all this slowdown. This is a good example of a place where Skia really benefits from compile-time NEON.) BUG=skia:4117,skia:4114 No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/1264893002
Diffstat (limited to 'src/core/SkOpts.h')
-rw-r--r--src/core/SkOpts.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/SkOpts.h b/src/core/SkOpts.h
index 71abae5d7a..f02ec97553 100644
--- a/src/core/SkOpts.h
+++ b/src/core/SkOpts.h
@@ -16,7 +16,10 @@ namespace SkOpts {
// Called by SkGraphics::Init(), and automatically #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS.
void Init();
- // (Function pointers go here).
+ // Declare function pointers here...
+
+ // Returns a fast approximation of 1.0f/sqrtf(x).
+ extern float (*rsqrt)(float);
}
#endif//SkOpts_DEFINED