Index: include/gpu/GrProcessorUnitTest.h |
diff --git a/include/gpu/GrProcessorUnitTest.h b/include/gpu/GrProcessorUnitTest.h |
index 66ba2396029724925e1214c0f4729b23098e3855..8a17521bfce2bfd6f92f77c992301759de70285f 100644 |
--- a/include/gpu/GrProcessorUnitTest.h |
+++ b/include/gpu/GrProcessorUnitTest.h |
@@ -68,10 +68,19 @@ public: |
GetFactories()->push_back(this); |
} |
- static const Processor* CreateStage(GrProcessorTestData* data) { |
+ /** Pick a random factory function and create a processor. */ |
+ static const Processor* Create(GrProcessorTestData* data) { |
VerifyFactoryCount(); |
SkASSERT(GetFactories()->count()); |
uint32_t idx = data->fRandom->nextRangeU(0, GetFactories()->count() - 1); |
+ return CreateIdx(idx, data); |
+ } |
+ |
+ /** Number of registered factory functions */ |
+ static int Count() { return GetFactories()->count(); } |
+ |
+ /** Use factory function at Index idx to create a processor. */ |
+ static const Processor* CreateIdx(int idx, GrProcessorTestData* data) { |
GrProcessorTestFactory<Processor>* factory = (*GetFactories())[idx]; |
return factory->fCreateProc(data); |
} |