Report the effect type when TestCreate returns null.
This is a quality-of-life improvement when debugging processor
unit tests.
Change-Id: I6eba2ea17710e224852e4688c5cc491ed09461ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305690
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/GrProcessorUnitTest.h b/src/gpu/GrProcessorUnitTest.h
index 341acaf..044f20f 100644
--- a/src/gpu/GrProcessorUnitTest.h
+++ b/src/gpu/GrProcessorUnitTest.h
@@ -87,7 +87,7 @@
public:
using MakeProc = ProcessorSmartPtr (*)(GrProcessorTestData*);
- GrProcessorTestFactory(MakeProc makeProc);
+ GrProcessorTestFactory(MakeProc makeProc, const char* name);
/** Pick a random factory function and create a processor. */
static ProcessorSmartPtr Make(GrProcessorTestData* data);
@@ -104,6 +104,7 @@
static SkTArray<GrProcessorTestFactory<ProcessorSmartPtr>*, true>* GetFactories();
MakeProc fMakeProc;
+ SkString fName;
};
using GrFragmentProcessorTestFactory = GrProcessorTestFactory<std::unique_ptr<GrFragmentProcessor>>;
@@ -147,10 +148,10 @@
* GrProcessor* TestCreate(GrProcessorTestData*);
*/
#define GR_DEFINE_FRAGMENT_PROCESSOR_TEST(Effect) \
- GrFragmentProcessorTestFactory Effect::gTestFactory(Effect::TestCreate)
+ GrFragmentProcessorTestFactory Effect::gTestFactory(Effect::TestCreate, #Effect)
#define GR_DEFINE_GEOMETRY_PROCESSOR_TEST(Effect) \
- GrGeometryProcessorTestFactory Effect::gTestFactory(Effect::TestCreate)
+ GrGeometryProcessorTestFactory Effect::gTestFactory(Effect::TestCreate, #Effect)
#define GR_DEFINE_XP_FACTORY_TEST(Factory) \
GrXPFactoryTestFactory Factory::gTestFactory(Factory::TestGet)