OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrBatchTest.h" | 8 #include "GrBatchTest.h" |
9 #include "SkRandom.h" | 9 #include "SkRandom.h" |
10 #include "SkTypes.h" | 10 #include "SkTypes.h" |
11 | 11 |
12 #ifdef GR_TEST_UTILS | 12 #ifdef GR_TEST_UTILS |
13 | 13 |
14 BATCH_TEST_EXTERN(AAFillRectBatch); | 14 BATCH_TEST_EXTERN(AAFillRectBatch); |
15 BATCH_TEST_EXTERN(AAStrokeRectBatch); | 15 BATCH_TEST_EXTERN(AAStrokeRectBatch); |
| 16 BATCH_TEST_EXTERN(DashBatch); |
| 17 BATCH_TEST_EXTERN(CircleBatch); |
| 18 BATCH_TEST_EXTERN(DIEllipseBatch); |
| 19 BATCH_TEST_EXTERN(EllipseBatch); |
| 20 BATCH_TEST_EXTERN(RRectBatch); |
16 | 21 |
17 static BatchTestFunc gTestBatches[] = { | 22 static BatchTestFunc gTestBatches[] = { |
18 BATCH_TEST_ENTRY(AAFillRectBatch), | 23 BATCH_TEST_ENTRY(AAFillRectBatch), |
19 BATCH_TEST_ENTRY(AAStrokeRectBatch), | 24 BATCH_TEST_ENTRY(AAStrokeRectBatch), |
| 25 BATCH_TEST_ENTRY(DashBatch), |
| 26 BATCH_TEST_ENTRY(CircleBatch), |
| 27 BATCH_TEST_ENTRY(DIEllipseBatch), |
| 28 BATCH_TEST_ENTRY(EllipseBatch), |
| 29 BATCH_TEST_ENTRY(RRectBatch) |
| 30 |
20 }; | 31 }; |
21 | 32 |
22 GrBatch* GrRandomBatch(SkRandom* random, GrContext* context) { | 33 GrBatch* GrRandomBatch(SkRandom* random, GrContext* context) { |
23 uint32_t index = random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(
gTestBatches))); | 34 uint32_t index = random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(
gTestBatches))); |
24 BatchTestFunc func = gTestBatches[index]; | 35 BatchTestFunc func = gTestBatches[index]; |
25 return (*func)(random, context); | 36 return (*func)(random, context); |
26 } | 37 } |
27 #endif | 38 #endif |
OLD | NEW |