Index: src/gpu/GrBatchTest.cpp |
diff --git a/src/gpu/GrBatchTest.cpp b/src/gpu/GrBatchTest.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4a368311a2c61963b5fad5cd4e31f8c28c95c1d2 |
--- /dev/null |
+++ b/src/gpu/GrBatchTest.cpp |
@@ -0,0 +1,27 @@ |
+/* |
+ * Copyright 2015 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#include "GrBatchTest.h" |
+#include "SkRandom.h" |
+#include "SkTypes.h" |
+ |
+#ifdef GR_TEST_UTILS |
+ |
+BATCH_TEST_EXTERN(AAFillRectBatch); |
+BATCH_TEST_EXTERN(AAStrokeRectBatch); |
+ |
+static BatchTestFunc gTestBatches[] = { |
+ BATCH_TEST_ENTRY(AAFillRectBatch), |
+ BATCH_TEST_ENTRY(AAStrokeRectBatch), |
+}; |
+ |
+GrBatch* GrRandomBatch(SkRandom* random, GrContext* context) { |
+ uint32_t index = random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gTestBatches))); |
+ BatchTestFunc func = gTestBatches[index]; |
+ return (*func)(random, context); |
+} |
+#endif |