blob: 71b112d20f9c6ccd6b9f9ab4a21fe099848f31b2 [file] [log] [blame]
bsalomon506c8022015-09-14 13:16:26 -07001/*
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 Canary6f6961e2017-01-31 13:50:44 -050011#if GR_TEST_UTILS
12
bungeman06ca8ec2016-06-09 08:01:03 -070013sk_sp<GrFragmentProcessor> GrProcessorUnitTest::MakeChildFP(GrProcessorTestData* data) {
bsalomon506c8022015-09-14 13:16:26 -070014#if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
bungeman06ca8ec2016-06-09 08:01:03 -070015 sk_sp<GrFragmentProcessor> fp;
bsalomon506c8022015-09-14 13:16:26 -070016 do {
bungeman06ca8ec2016-06-09 08:01:03 -070017 fp = GrProcessorTestFactory<GrFragmentProcessor>::Make(data);
bsalomon506c8022015-09-14 13:16:26 -070018 SkASSERT(fp);
19 } while (fp->numChildProcessors() != 0);
bungeman06ca8ec2016-06-09 08:01:03 -070020 return fp;
bsalomon506c8022015-09-14 13:16:26 -070021#else
22 SkFAIL("Should not be called if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS");
23 return nullptr;
24#endif
25}
Hal Canary6f6961e2017-01-31 13:50:44 -050026#endif