joshualitt | 3f655f3 | 2015-04-29 10:01:22 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
bsalomon | abd30f5 | 2015-08-13 13:34:48 -0700 | [diff] [blame] | 15 | class GrDrawBatch; |
joshualitt | 3f655f3 | 2015-04-29 10:01:22 -0700 | [diff] [blame] | 16 | class GrContext; |
| 17 | class 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 | |
bsalomon | abd30f5 | 2015-08-13 13:34:48 -0700 | [diff] [blame] | 24 | // Batches should define test functions using DRAW_BATCH_TEST_DEFINE. The other macros defined |
| 25 | // below are used exclusively by the test harness. |
| 26 | typedef GrDrawBatch* (*BatchTestFunc)(SkRandom* random, GrContext* context); |
| 27 | #define DRAW_BATCH_TEST_DEFINE(Batch) \ |
| 28 | GrDrawBatch* Batch##__Test(SkRandom* random, GrContext* context) |
| 29 | #define DRAW_BATCH_TEST_EXTERN(Batch) \ |
| 30 | extern GrDrawBatch* Batch##__Test(SkRandom*, GrContext* context); |
| 31 | #define DRAW_BATCH_TEST_ENTRY(Batch) \ |
joshualitt | 79dfb2b | 2015-05-11 08:58:08 -0700 | [diff] [blame] | 32 | Batch##__Test |
bsalomon | abd30f5 | 2015-08-13 13:34:48 -0700 | [diff] [blame] | 33 | #define DRAW_BATCH_TEST_FRIEND(Batch) \ |
| 34 | friend GrDrawBatch* Batch##__Test(SkRandom* random, GrContext* context); |
joshualitt | 3f655f3 | 2015-04-29 10:01:22 -0700 | [diff] [blame] | 35 | |
bsalomon | abd30f5 | 2015-08-13 13:34:48 -0700 | [diff] [blame] | 36 | GrDrawBatch* GrRandomDrawBatch(SkRandom*, GrContext*); |
joshualitt | 3f655f3 | 2015-04-29 10:01:22 -0700 | [diff] [blame] | 37 | |
| 38 | #endif |
| 39 | #endif |