blob: 3f43389fe06d01997ff6b6e84308f35157b38c05 [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
bungeman06ca8ec2016-06-09 08:01:03 -070011sk_sp<GrFragmentProcessor> GrProcessorUnitTest::MakeChildFP(GrProcessorTestData* data) {
bsalomon506c8022015-09-14 13:16:26 -070012#if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
bungeman06ca8ec2016-06-09 08:01:03 -070013 sk_sp<GrFragmentProcessor> fp;
bsalomon506c8022015-09-14 13:16:26 -070014 do {
bungeman06ca8ec2016-06-09 08:01:03 -070015 fp = GrProcessorTestFactory<GrFragmentProcessor>::Make(data);
bsalomon506c8022015-09-14 13:16:26 -070016 SkASSERT(fp);
17 } while (fp->numChildProcessors() != 0);
bungeman06ca8ec2016-06-09 08:01:03 -070018 return fp;
bsalomon506c8022015-09-14 13:16:26 -070019#else
20 SkFAIL("Should not be called if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS");
21 return nullptr;
22#endif
23}