blob: 9daa9609ce784c72aca334eb3d22d4e2c1132d31 [file] [log] [blame]
joshualitt3f655f32015-04-29 10:01:22 -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#ifndef GrBatchTest_DEFINED
9#define GrBatchTest_DEFINED
10
11#include "GrTestUtils.h"
12
13#ifdef GR_TEST_UTILS
14
15class GrBatch;
16class GrContext;
17class SkRandom;
18
19/*
20 * This file defines some macros for testing batches, and also declares functions / objects which
21 * are generally useful for GrBatch testing
22 */
23
24// Batches should define test functions using BATCH_TEST_DEFINE. The other macros defined below
25// are used exclusively by the test harness.
26typedef GrBatch* (*BatchTestFunc)(SkRandom* random, GrContext* context);
27#define BATCH_TEST_DEFINE(Batch) \
28 GrBatch* Batch##__Test(SkRandom* random, GrContext* context)
29#define BATCH_TEST_EXTERN(Batch) \
30 extern GrBatch* Batch##__Test(SkRandom*, GrContext* context);
31#define BATCH_TEST_ENTRY(Batch) \
joshualitt79dfb2b2015-05-11 08:58:08 -070032 Batch##__Test
33#define BATCH_TEST_FRIEND(Batch) \
34 friend GrBatch* Batch##__Test(SkRandom* random, GrContext* context);
joshualitt3f655f32015-04-29 10:01:22 -070035
36GrBatch* GrRandomBatch(SkRandom*, GrContext*);
37
38#endif
39#endif