aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-04-19 12:42:24 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-19 12:42:24 -0700
commit05db63b5fc262136da9b289418b871180cd1359b (patch)
tree6b4a4dadaaafbd09d5f398a6119e6601cdfe014c /src
parenta7c9d6303a4bd3bda9d7b3f73334f182b11338c4 (diff)
Remove static initializer for SkOpts::Init()
Static initializers run in a confusing unspecified order, so it's best to have as few of them as possible. Most tools and clients I can find already call SkGraphics::Init(), (or equivalently create an SkAutoGraphics) which calls SkOpts::Init(): - Chrome - Chrome renderer - Android - DM - nanobench - SampleApp - VisualBench - the old debugger Seems like the only thing relying on this static initializer today is the new debugger, fixed here. TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1903503002 Review URL: https://codereview.chromium.org/1903503002
Diffstat (limited to 'src')
-rw-r--r--src/core/SkOpts.cpp8
-rw-r--r--src/core/SkOpts.h2
2 files changed, 2 insertions, 8 deletions
diff --git a/src/core/SkOpts.cpp b/src/core/SkOpts.cpp
index 3c6b5c12c8..72c997e7bd 100644
--- a/src/core/SkOpts.cpp
+++ b/src/core/SkOpts.cpp
@@ -141,10 +141,4 @@ namespace SkOpts {
static SkOnce once;
once(init);
}
-
-#if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
- static struct AutoInit {
- AutoInit() { Init(); }
- } gAutoInit;
-#endif
-}
+} // namespace SkOpts
diff --git a/src/core/SkOpts.h b/src/core/SkOpts.h
index bc3ea00140..04c9f00de3 100644
--- a/src/core/SkOpts.h
+++ b/src/core/SkOpts.h
@@ -17,7 +17,7 @@ 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.
+ // Called by SkGraphics::Init().
void Init();
// Declare function pointers here...