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(AAConvexPathBatch); | 14 BATCH_TEST_EXTERN(AAConvexPathBatch); |
15 BATCH_TEST_EXTERN(AADistanceFieldPathBatch); | 15 BATCH_TEST_EXTERN(AADistanceFieldPathBatch); |
16 BATCH_TEST_EXTERN(AAFillRectBatch); | 16 BATCH_TEST_EXTERN(AAFillRectBatch); |
17 BATCH_TEST_EXTERN(AAHairlineBatch); | 17 BATCH_TEST_EXTERN(AAHairlineBatch); |
18 BATCH_TEST_EXTERN(AAStrokeRectBatch); | 18 BATCH_TEST_EXTERN(AAStrokeRectBatch); |
19 BATCH_TEST_EXTERN(DashBatch); | 19 BATCH_TEST_EXTERN(DashBatch); |
20 BATCH_TEST_EXTERN(DefaultPathBatch); | 20 BATCH_TEST_EXTERN(DefaultPathBatch); |
21 BATCH_TEST_EXTERN(CircleBatch); | 21 BATCH_TEST_EXTERN(CircleBatch); |
22 BATCH_TEST_EXTERN(DIEllipseBatch); | 22 BATCH_TEST_EXTERN(DIEllipseBatch); |
23 BATCH_TEST_EXTERN(EllipseBatch); | 23 BATCH_TEST_EXTERN(EllipseBatch); |
| 24 BATCH_TEST_EXTERN(GrStrokeRectBatch); |
24 BATCH_TEST_EXTERN(RRectBatch); | 25 BATCH_TEST_EXTERN(RRectBatch); |
25 BATCH_TEST_EXTERN(StrokeRectBatch); | |
26 BATCH_TEST_EXTERN(TesselatingPathBatch); | 26 BATCH_TEST_EXTERN(TesselatingPathBatch); |
27 BATCH_TEST_EXTERN(TextBlobBatch); | 27 BATCH_TEST_EXTERN(TextBlobBatch); |
28 BATCH_TEST_EXTERN(VerticesBatch); | 28 BATCH_TEST_EXTERN(VerticesBatch); |
29 | 29 |
30 static BatchTestFunc gTestBatches[] = { | 30 static BatchTestFunc gTestBatches[] = { |
31 BATCH_TEST_ENTRY(AAConvexPathBatch), | 31 BATCH_TEST_ENTRY(AAConvexPathBatch), |
32 BATCH_TEST_ENTRY(AADistanceFieldPathBatch), | 32 BATCH_TEST_ENTRY(AADistanceFieldPathBatch), |
33 BATCH_TEST_ENTRY(AAFillRectBatch), | 33 BATCH_TEST_ENTRY(AAFillRectBatch), |
34 BATCH_TEST_ENTRY(AAHairlineBatch), | 34 BATCH_TEST_ENTRY(AAHairlineBatch), |
35 BATCH_TEST_ENTRY(AAStrokeRectBatch), | 35 BATCH_TEST_ENTRY(AAStrokeRectBatch), |
36 BATCH_TEST_ENTRY(DashBatch), | 36 BATCH_TEST_ENTRY(DashBatch), |
37 BATCH_TEST_ENTRY(DefaultPathBatch), | 37 BATCH_TEST_ENTRY(DefaultPathBatch), |
38 BATCH_TEST_ENTRY(CircleBatch), | 38 BATCH_TEST_ENTRY(CircleBatch), |
39 BATCH_TEST_ENTRY(DIEllipseBatch), | 39 BATCH_TEST_ENTRY(DIEllipseBatch), |
40 BATCH_TEST_ENTRY(EllipseBatch), | 40 BATCH_TEST_ENTRY(EllipseBatch), |
| 41 BATCH_TEST_ENTRY(GrStrokeRectBatch), |
41 BATCH_TEST_ENTRY(RRectBatch), | 42 BATCH_TEST_ENTRY(RRectBatch), |
42 BATCH_TEST_ENTRY(StrokeRectBatch), | |
43 BATCH_TEST_ENTRY(TesselatingPathBatch), | 43 BATCH_TEST_ENTRY(TesselatingPathBatch), |
44 BATCH_TEST_ENTRY(TextBlobBatch), | 44 BATCH_TEST_ENTRY(TextBlobBatch), |
45 BATCH_TEST_ENTRY(VerticesBatch) | 45 BATCH_TEST_ENTRY(VerticesBatch) |
46 }; | 46 }; |
47 | 47 |
48 GrBatch* GrRandomBatch(SkRandom* random, GrContext* context) { | 48 GrBatch* GrRandomBatch(SkRandom* random, GrContext* context) { |
49 uint32_t index = random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(
gTestBatches))); | 49 uint32_t index = random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(
gTestBatches))); |
50 BatchTestFunc func = gTestBatches[index]; | 50 BatchTestFunc func = gTestBatches[index]; |
51 return (*func)(random, context); | 51 return (*func)(random, context); |
52 } | 52 } |
53 #endif | 53 #endif |
OLD | NEW |