aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBatchTest.h
blob: 9daa9609ce784c72aca334eb3d22d4e2c1132d31 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Copyright 2015 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrBatchTest_DEFINED
#define GrBatchTest_DEFINED

#include "GrTestUtils.h"

#ifdef GR_TEST_UTILS

class GrBatch;
class GrContext;
class SkRandom;

/*
 * This file defines some macros for testing batches, and also declares functions / objects which
 * are generally useful for GrBatch testing
 */

// Batches should define test functions using BATCH_TEST_DEFINE.  The other macros defined below
// are used exclusively by the test harness.
typedef GrBatch* (*BatchTestFunc)(SkRandom* random, GrContext* context);
#define BATCH_TEST_DEFINE(Batch) \
    GrBatch* Batch##__Test(SkRandom* random, GrContext* context)
#define BATCH_TEST_EXTERN(Batch) \
    extern GrBatch* Batch##__Test(SkRandom*, GrContext* context);
#define BATCH_TEST_ENTRY(Batch) \
    Batch##__Test
#define BATCH_TEST_FRIEND(Batch) \
    friend GrBatch* Batch##__Test(SkRandom* random, GrContext* context);

GrBatch* GrRandomBatch(SkRandom*, GrContext*);

#endif
#endif