aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-09-14 13:16:26 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-14 13:16:26 -0700
commit506c802a3dd3b6dc8a172621ff2a1f9bda202a13 (patch)
tree45db20ee4dfc71615d85a7da127fa1bf6f75cac3 /src/gpu/effects/GrXfermodeFragmentProcessor.cpp
parent07344a5386b70f682b16b40bc6eb83acf76d6921 (diff)
Add helper for creating leaf FPs inside GrFP::TestCreate functions
Diffstat (limited to 'src/gpu/effects/GrXfermodeFragmentProcessor.cpp')
-rw-r--r--src/gpu/effects/GrXfermodeFragmentProcessor.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
index c039db3433..ab944d86fc 100644
--- a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
+++ b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
@@ -72,28 +72,13 @@ private:
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrComposeTwoFragmentProcessor);
const GrFragmentProcessor* GrComposeTwoFragmentProcessor::TestCreate(GrProcessorTestData* d) {
-#if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
// Create two random frag procs.
- // For now, we'll prevent either children from being a shader with children to prevent the
- // possibility of an arbitrarily large tree of procs.
- SkAutoTUnref<const GrFragmentProcessor> fpA;
- do {
- fpA.reset(GrProcessorTestFactory<GrFragmentProcessor>::Create(d));
- SkASSERT(fpA);
- } while (fpA->numChildProcessors() != 0);
- SkAutoTUnref<const GrFragmentProcessor> fpB;
- do {
- fpB.reset(GrProcessorTestFactory<GrFragmentProcessor>::Create(d));
- SkASSERT(fpB);
- } while (fpB->numChildProcessors() != 0);
+ SkAutoTUnref<const GrFragmentProcessor> fpA(GrProcessorUnitTest::CreateChildFP(d));
+ SkAutoTUnref<const GrFragmentProcessor> fpB(GrProcessorUnitTest::CreateChildFP(d));
SkXfermode::Mode mode = static_cast<SkXfermode::Mode>(
d->fRandom->nextRangeU(0, SkXfermode::kLastCoeffMode));
return SkNEW_ARGS(GrComposeTwoFragmentProcessor, (fpA, fpB, mode));
-#else
- SkFAIL("Should not be called if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS");
- return nullptr;
-#endif
}
GrGLFragmentProcessor* GrComposeTwoFragmentProcessor::onCreateGLInstance() const{