blob: 7e8d7132e8d98e9581cf906d0eb22b91a2b4ead8 [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
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 return nullptr;
24#endif
25}
Hal Canary6f6961e2017-01-31 13:50:44 -050026#endif