Remove SK_ALLOW_STATIC_GLOBAL_INITIALIZERS from tests.
The tests themselves should run fine if no factories were actually
registered. This isolates the last uses of this flag to the gpu code
which is actually depending on it.
Change-Id: Ief9c01abfc37c4e071d946d70ef85f13f94ae0f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213301
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp
index 34370de..2a58b54 100644
--- a/src/gpu/GrProcessor.cpp
+++ b/src/gpu/GrProcessor.cpp
@@ -27,7 +27,6 @@
const GrCaps* GrProcessorTestData::caps() { return fContext->priv().caps(); }
-#if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
class GrFragmentProcessor;
class GrGeometryProcessor;
@@ -57,9 +56,15 @@
* we verify the count is as expected. If a new factory is added, then these numbers must be
* manually adjusted.
*/
+#if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
static const int kFPFactoryCount = 36;
static const int kGPFactoryCount = 14;
static const int kXPFactoryCount = 4;
+#else
+static const int kFPFactoryCount = 0;
+static const int kGPFactoryCount = 0;
+static const int kXPFactoryCount = 0;
+#endif
template <>
void GrFragmentProcessorTestFactory::VerifyFactoryCount() {
@@ -88,7 +93,6 @@
}
#endif
-#endif
// We use a global pool protected by a mutex(spinlock). Chrome may use the same GrContext on