Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Unified Diff: src/gpu/effects/GrXfermodeFragmentProcessor.cpp

Issue 1334273003: Add helper for creating leaf FPs inside GrFP::TestCreate functions (Closed) Base URL: https://skia.googlesource.com/skia.git@noinputtest
Patch Set: address comment Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrXfermodeFragmentProcessor.cpp
diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
index c039db343315b6610ee1d4a62048becd2ffa2ba3..ab944d86fcbcb19f1bc157bf753fa135da503e76 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{
« no previous file with comments | « src/gpu/effects/GrExtractAlphaFragmentProcessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698