blob: 8d8efa7685b0a30f51ab9843977e0e8aa9c963fa [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
Mike Kleinc0bd9f92019-04-23 12:05:21 -05008#include "src/gpu/GrFragmentProcessor.h"
9#include "src/gpu/GrProcessorUnitTest.h"
bsalomon506c8022015-09-14 13:16:26 -070010
Hal Canary6f6961e2017-01-31 13:50:44 -050011#if GR_TEST_UTILS
12
Brian Salomonaff329b2017-08-11 09:40:37 -040013std::unique_ptr<GrFragmentProcessor> GrProcessorUnitTest::MakeChildFP(GrProcessorTestData* data) {
bsalomon506c8022015-09-14 13:16:26 -070014#if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
Brian Salomonaff329b2017-08-11 09:40:37 -040015 std::unique_ptr<GrFragmentProcessor> fp;
bsalomon506c8022015-09-14 13:16:26 -070016 do {
Brian Salomon1c053642017-07-24 10:16:19 -040017 fp = GrFragmentProcessorTestFactory::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
Ben Wagnerb4aab9a2017-08-16 10:53:04 -040022 SK_ABORT("Should not be called if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS");
bsalomon506c8022015-09-14 13:16:26 -070023#endif
24}
Hal Canary6f6961e2017-01-31 13:50:44 -050025#endif