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 | |
bungeman | 06ca8ec | 2016-06-09 08:01:03 -0700 | [diff] [blame] | 11 | sk_sp<GrFragmentProcessor> GrProcessorUnitTest::MakeChildFP(GrProcessorTestData* data) { |
bsalomon | 506c802 | 2015-09-14 13:16:26 -0700 | [diff] [blame] | 12 | #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
bungeman | 06ca8ec | 2016-06-09 08:01:03 -0700 | [diff] [blame] | 13 | sk_sp<GrFragmentProcessor> fp; |
bsalomon | 506c802 | 2015-09-14 13:16:26 -0700 | [diff] [blame] | 14 | do { |
bungeman | 06ca8ec | 2016-06-09 08:01:03 -0700 | [diff] [blame] | 15 | fp = GrProcessorTestFactory<GrFragmentProcessor>::Make(data); |
bsalomon | 506c802 | 2015-09-14 13:16:26 -0700 | [diff] [blame] | 16 | SkASSERT(fp); |
| 17 | } while (fp->numChildProcessors() != 0); |
bungeman | 06ca8ec | 2016-06-09 08:01:03 -0700 | [diff] [blame] | 18 | return fp; |
bsalomon | 506c802 | 2015-09-14 13:16:26 -0700 | [diff] [blame] | 19 | #else |
| 20 | SkFAIL("Should not be called if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS"); |
| 21 | return nullptr; |
| 22 | #endif |
| 23 | } |