bsalomon | 506c802 | 2015-09-14 13:16:26 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "GrProcessorUnitTest.h" |
| 9 | #include "GrFragmentProcessor.h" |
| 10 | |
Hal Canary | 6f6961e | 2017-01-31 13:50:44 -0500 | [diff] [blame] | 11 | #if GR_TEST_UTILS |
| 12 | |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 13 | std::unique_ptr<GrFragmentProcessor> GrProcessorUnitTest::MakeChildFP(GrProcessorTestData* data) { |
bsalomon | 506c802 | 2015-09-14 13:16:26 -0700 | [diff] [blame] | 14 | #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 15 | std::unique_ptr<GrFragmentProcessor> fp; |
bsalomon | 506c802 | 2015-09-14 13:16:26 -0700 | [diff] [blame] | 16 | do { |
Brian Salomon | 1c05364 | 2017-07-24 10:16:19 -0400 | [diff] [blame] | 17 | fp = GrFragmentProcessorTestFactory::Make(data); |
bsalomon | 506c802 | 2015-09-14 13:16:26 -0700 | [diff] [blame] | 18 | SkASSERT(fp); |
| 19 | } while (fp->numChildProcessors() != 0); |
bungeman | 06ca8ec | 2016-06-09 08:01:03 -0700 | [diff] [blame] | 20 | return fp; |
bsalomon | 506c802 | 2015-09-14 13:16:26 -0700 | [diff] [blame] | 21 | #else |
Ben Wagner | b4aab9a | 2017-08-16 10:53:04 -0400 | [diff] [blame] | 22 | SK_ABORT("Should not be called if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS"); |
bsalomon | 506c802 | 2015-09-14 13:16:26 -0700 | [diff] [blame] | 23 | return nullptr; |
| 24 | #endif |
| 25 | } |
Hal Canary | 6f6961e | 2017-01-31 13:50:44 -0500 | [diff] [blame] | 26 | #endif |