aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProcessorUnitTest.cpp
blob: 71b112d20f9c6ccd6b9f9ab4a21fe099848f31b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * Copyright 2015 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "GrProcessorUnitTest.h"
#include "GrFragmentProcessor.h"

#if GR_TEST_UTILS

sk_sp<GrFragmentProcessor> GrProcessorUnitTest::MakeChildFP(GrProcessorTestData* data) {
#if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
    sk_sp<GrFragmentProcessor> fp;
    do {
        fp = GrProcessorTestFactory<GrFragmentProcessor>::Make(data);
        SkASSERT(fp);
    } while (fp->numChildProcessors() != 0);
    return fp;
#else
    SkFAIL("Should not be called if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS");
    return nullptr;
#endif
}
#endif