Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: src/gpu/GrBatchTest.cpp

Issue 1109153004: Initial CL to create GrBatchTest infrastructure (Closed) Base URL: https://skia.googlesource.com/skia.git@rand-batch0
Patch Set: windows warnings Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « src/gpu/GrBatchTest.h ('k') | src/gpu/GrTestUtils.cpp » ('j') | src/gpu/GrTestUtils.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698