Revert "Revert "Removing ref counting from GrXPFactory.""
This reverts commit 003312a211e65f35e402d6fe80a32e23d4c94ac4.
Change-Id: Ib41065e5c356d1dd99e70fa10611ac6756c2b79d
Reviewed-on: https://skia-review.googlesource.com/6803
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp
index 991aa90..0512aa8 100644
--- a/src/gpu/GrProcessor.cpp
+++ b/src/gpu/GrProcessor.cpp
@@ -32,19 +32,17 @@
}
template<>
-SkTArray<GrProcessorTestFactory<GrXPFactory>*, true>*
-GrProcessorTestFactory<GrXPFactory>::GetFactories() {
- static SkTArray<GrProcessorTestFactory<GrXPFactory>*, true> gFactories;
- return &gFactories;
-}
-
-template<>
SkTArray<GrProcessorTestFactory<GrGeometryProcessor>*, true>*
GrProcessorTestFactory<GrGeometryProcessor>::GetFactories() {
static SkTArray<GrProcessorTestFactory<GrGeometryProcessor>*, true> gFactories;
return &gFactories;
}
+SkTArray<GrXPFactoryTestFactory*, true>* GrXPFactoryTestFactory::GetFactories() {
+ static SkTArray<GrXPFactoryTestFactory*, true> gFactories;
+ return &gFactories;
+}
+
/*
* To ensure we always have successful static initialization, before creating from the factories
* we verify the count is as expected. If a new factory is added, then these numbers must be
@@ -72,8 +70,7 @@
}
}
-template<>
-void GrProcessorTestFactory<GrXPFactory>::VerifyFactoryCount() {
+void GrXPFactoryTestFactory::VerifyFactoryCount() {
if (kXPFactoryCount != GetFactories()->count()) {
SkDebugf("\nExpected %d xp factory factories, found %d.\n",
kXPFactoryCount, GetFactories()->count());
@@ -229,8 +226,3 @@
break;
}
}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// Initial static variable from GrXPFactory
-int32_t GrXPFactory::gCurrXPFClassID = GrXPFactory::kIllegalXPFClassID;