aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-09-14 11:55:51 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-14 11:55:52 -0700
commit72c58e7052af2a0855412ce4b249f977069db751 (patch)
treeede198f2a29caa2b188235d738bd3cf731f769f6 /include/gpu
parent3833daaa663db7e655a8077cdab42cca19d3a276 (diff)
Test that GrFragmentProcessors work without input colors.
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrProcessorUnitTest.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/gpu/GrProcessorUnitTest.h b/include/gpu/GrProcessorUnitTest.h
index 66ba239602..8a17521bfc 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);
}